diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-03-19 09:25:14 +0100 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-03-19 09:56:31 +0100 |
commit | 6313e1fe4c27755adde87e62db1c2f9fac534ae4 (patch) | |
tree | c57bb29f65e02fbfcc07895a8cc2903fff9300ba /src/3rdparty/v8/src/ia32/builtins-ia32.cc | |
parent | b5a49a260d03249c386f1b63c249089383dd81fa (diff) | |
parent | cac65e7a222b848a735a974b0aeb43209b0cfa18 (diff) | |
download | qtjsbackend-6313e1fe4c27755adde87e62db1c2f9fac534ae4.tar.gz |
Merge branch 'dev' into stable
This starts Qt 5.1 release cycle
Change-Id: I892bbc73c276842894a720f761ce31ad1b015672
Diffstat (limited to 'src/3rdparty/v8/src/ia32/builtins-ia32.cc')
-rw-r--r-- | src/3rdparty/v8/src/ia32/builtins-ia32.cc | 90 |
1 files changed, 82 insertions, 8 deletions
diff --git a/src/3rdparty/v8/src/ia32/builtins-ia32.cc b/src/3rdparty/v8/src/ia32/builtins-ia32.cc index a36763d..01785bb 100644 --- a/src/3rdparty/v8/src/ia32/builtins-ia32.cc +++ b/src/3rdparty/v8/src/ia32/builtins-ia32.cc @@ -74,6 +74,43 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, } +static void GenerateTailCallToSharedCode(MacroAssembler* masm) { + __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); + __ mov(eax, FieldOperand(eax, SharedFunctionInfo::kCodeOffset)); + __ lea(eax, FieldOperand(eax, Code::kHeaderSize)); + __ jmp(eax); +} + + +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(edi); + // Push call kind information. + __ push(ecx); + + __ push(edi); // Function is also the parameter to the runtime call. + __ CallRuntime(Runtime::kParallelRecompile, 1); + + // Restore call kind information. + __ pop(ecx); + // Restore receiver. + __ pop(edi); + + // Tear down internal frame. + } + + GenerateTailCallToSharedCode(masm); +} + + static void Generate_JSConstructStubHelper(MacroAssembler* masm, bool is_api_function, bool count_constructions) { @@ -501,6 +538,42 @@ void Builtins::Generate_LazyRecompile(MacroAssembler* masm) { } +static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { + // For now, we are relying on the fact that make_code_young doesn't do any + // garbage collection which allows us to save/restore the registers without + // worrying about which of them contain pointers. We also don't build an + // internal frame to make the code faster, since we shouldn't have to do stack + // crawls in MakeCodeYoung. This seems a bit fragile. + + // Re-execute the code that was patched back to the young age when + // the stub returns. + __ sub(Operand(esp, 0), Immediate(5)); + __ pushad(); + __ mov(eax, Operand(esp, 8 * kPointerSize)); + { + FrameScope scope(masm, StackFrame::MANUAL); + __ PrepareCallCFunction(1, ebx); + __ mov(Operand(esp, 0), eax); + __ CallCFunction( + ExternalReference::get_make_code_young_function(masm->isolate()), 1); + } + __ popad(); + __ ret(0); +} + +#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \ +void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \ + MacroAssembler* masm) { \ + GenerateMakeCodeYoungAgainCommon(masm); \ +} \ +void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \ + MacroAssembler* masm) { \ + GenerateMakeCodeYoungAgainCommon(masm); \ +} +CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) +#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR + + static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, Deoptimizer::BailoutType type) { { @@ -641,9 +714,9 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { // receiver. __ bind(&use_global_receiver); const int kGlobalIndex = - Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; + Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; __ mov(ebx, FieldOperand(esi, kGlobalIndex)); - __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalContextOffset)); + __ mov(ebx, FieldOperand(ebx, GlobalObject::kNativeContextOffset)); __ mov(ebx, FieldOperand(ebx, kGlobalIndex)); __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset)); @@ -819,9 +892,9 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { // Use the current global receiver object as the receiver. __ bind(&use_global_receiver); const int kGlobalOffset = - Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; + Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; __ mov(ebx, FieldOperand(esi, kGlobalOffset)); - __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalContextOffset)); + __ mov(ebx, FieldOperand(ebx, GlobalObject::kNativeContextOffset)); __ mov(ebx, FieldOperand(ebx, kGlobalOffset)); __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset)); @@ -900,7 +973,7 @@ static void AllocateEmptyJSArray(MacroAssembler* masm, const int initial_capacity = JSArray::kPreallocatedArrayElements; STATIC_ASSERT(initial_capacity >= 0); - __ LoadInitialArrayMap(array_function, scratch2, scratch1); + __ LoadInitialArrayMap(array_function, scratch2, scratch1, false); // Allocate the JSArray object together with space for a fixed array with the // requested elements. @@ -1003,7 +1076,8 @@ static void AllocateJSArray(MacroAssembler* masm, ASSERT(!fill_with_hole || array_size.is(ecx)); // rep stos count ASSERT(!fill_with_hole || !result.is(eax)); // result is never eax - __ LoadInitialArrayMap(array_function, scratch, elements_array); + __ LoadInitialArrayMap(array_function, scratch, + elements_array, fill_with_hole); // Allocate the JSArray object together with space for a FixedArray with the // requested elements. @@ -1274,11 +1348,11 @@ static void ArrayNativeCode(MacroAssembler* masm, __ jmp(&prepare_generic_code_call); __ bind(¬_double); - // Transition FAST_SMI_ONLY_ELEMENTS to FAST_ELEMENTS. + // Transition FAST_SMI_ELEMENTS to FAST_ELEMENTS. __ mov(ebx, Operand(esp, 0)); __ mov(edi, FieldOperand(ebx, HeapObject::kMapOffset)); __ LoadTransitionedArrayMapConditional( - FAST_SMI_ONLY_ELEMENTS, + FAST_SMI_ELEMENTS, FAST_ELEMENTS, edi, eax, |