Skip to content

Commit

Permalink
Optimize functions on a second thread.
Browse files Browse the repository at this point in the history
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10807024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information
sanjoy@chromium.org committed Jul 19, 2012
1 parent 5b0d3a0 commit 693c764
Show file tree
Hide file tree
Showing 49 changed files with 822 additions and 153 deletions.
1 change: 1 addition & 0 deletions src/SConscript
Expand Up @@ -106,6 +106,7 @@ SOURCES = {
objects-visiting.cc
objects.cc
once.cc
optimizing-compiler-thread.cc
parser.cc
preparse-data.cc
preparser.cc
Expand Down
37 changes: 37 additions & 0 deletions src/arm/builtins-arm.cc
Expand Up @@ -697,6 +697,43 @@ void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
}


static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
__ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kCodeOffset));
__ add(r2, r2, Operand(Code::kHeaderSize - kHeapObjectTag));
__ mov(pc, r2);
}


void Builtins::Generate_InRecompileQueue(MacroAssembler* masm) {
GenerateTailCallToSharedCode(masm);
}


void Builtins::Generate_ParallelRecompile(MacroAssembler* masm) {
{
FrameScope scope(masm, StackFrame::INTERNAL);

// Push a copy of the function onto the stack.
__ push(r1);
// Push call kind information.
__ push(r5);

__ push(r1); // Function is also the parameter to the runtime call.
__ CallRuntime(Runtime::kParallelRecompile, 1);

// Restore call kind information.
__ pop(r5);
// Restore receiver.
__ pop(r1);

// Tear down internal frame.
}

GenerateTailCallToSharedCode(masm);
}


static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool count_constructions) {
Expand Down
2 changes: 1 addition & 1 deletion src/ast.h
Expand Up @@ -37,7 +37,7 @@
#include "list-inl.h"
#include "runtime.h"
#include "small-pointer-list.h"
#include "smart-array-pointer.h"
#include "smart-pointers.h"
#include "token.h"
#include "utils.h"
#include "variables.h"
Expand Down
6 changes: 6 additions & 0 deletions src/builtins.h
Expand Up @@ -66,6 +66,8 @@ enum BuiltinExtraArguments {
#define BUILTIN_LIST_A(V) \
V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(InRecompileQueue, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(JSConstructStubCountdown, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED, \
Expand All @@ -80,6 +82,8 @@ enum BuiltinExtraArguments {
Code::kNoExtraICState) \
V(LazyRecompile, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(ParallelRecompile, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(NotifyDeoptimized, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \
V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED, \
Expand Down Expand Up @@ -347,6 +351,8 @@ class Builtins {
static void Generate_Adaptor(MacroAssembler* masm,
CFunctionId id,
BuiltinExtraArguments extra_args);
static void Generate_InRecompileQueue(MacroAssembler* masm);
static void Generate_ParallelRecompile(MacroAssembler* masm);
static void Generate_JSConstructStubCountdown(MacroAssembler* masm);
static void Generate_JSConstructStubGeneric(MacroAssembler* masm);
static void Generate_JSConstructStubApi(MacroAssembler* masm);
Expand Down

0 comments on commit 693c764

Please sign in to comment.