| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 __ JumpIfSmi(entry, &maybe_call_runtime); | 934 __ JumpIfSmi(entry, &maybe_call_runtime); |
| 935 | 935 |
| 936 // Found literals and code. Get them into the closure and return. | 936 // Found literals and code. Get them into the closure and return. |
| 937 __ pop(closure); | 937 __ pop(closure); |
| 938 // Store code entry in the closure. | 938 // Store code entry in the closure. |
| 939 __ lea(entry, FieldOperand(entry, Code::kHeaderSize)); | 939 __ lea(entry, FieldOperand(entry, Code::kHeaderSize)); |
| 940 | 940 |
| 941 Label install_optimized_code_and_tailcall; | 941 Label install_optimized_code_and_tailcall; |
| 942 __ bind(&install_optimized_code_and_tailcall); | 942 __ bind(&install_optimized_code_and_tailcall); |
| 943 __ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); | 943 __ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); |
| 944 __ mov(ebx, entry); |
| 945 __ RecordWriteCodeEntryField(closure, ebx, eax); |
| 944 | 946 |
| 945 // Link the closure into the optimized function list. | 947 // Link the closure into the optimized function list. |
| 946 // ecx : code entry | 948 // ecx : code entry |
| 947 // edx : native context | 949 // edx : native context |
| 948 // edi : closure | 950 // edi : closure |
| 949 __ mov(ebx, | 951 __ mov(ebx, |
| 950 ContextOperand(native_context, Context::OPTIMIZED_FUNCTIONS_LIST)); | 952 ContextOperand(native_context, Context::OPTIMIZED_FUNCTIONS_LIST)); |
| 951 __ mov(FieldOperand(closure, JSFunction::kNextFunctionLinkOffset), ebx); | 953 __ mov(FieldOperand(closure, JSFunction::kNextFunctionLinkOffset), ebx); |
| 952 __ RecordWriteField(closure, JSFunction::kNextFunctionLinkOffset, ebx, eax, | 954 __ RecordWriteField(closure, JSFunction::kNextFunctionLinkOffset, ebx, eax, |
| 953 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 955 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 __ mov(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 992 __ mov(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
| 991 __ mov(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); | 993 __ mov(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); |
| 992 __ mov(ebx, FieldOperand(entry, Code::kFlagsOffset)); | 994 __ mov(ebx, FieldOperand(entry, Code::kFlagsOffset)); |
| 993 __ and_(ebx, Code::KindField::kMask); | 995 __ and_(ebx, Code::KindField::kMask); |
| 994 __ shr(ebx, Code::KindField::kShift); | 996 __ shr(ebx, Code::KindField::kShift); |
| 995 __ cmp(ebx, Immediate(Code::BUILTIN)); | 997 __ cmp(ebx, Immediate(Code::BUILTIN)); |
| 996 __ j(equal, &gotta_call_runtime_no_stack); | 998 __ j(equal, &gotta_call_runtime_no_stack); |
| 997 // Yes, install the full code. | 999 // Yes, install the full code. |
| 998 __ lea(entry, FieldOperand(entry, Code::kHeaderSize)); | 1000 __ lea(entry, FieldOperand(entry, Code::kHeaderSize)); |
| 999 __ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); | 1001 __ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); |
| 1002 __ mov(ebx, entry); |
| 1003 __ RecordWriteCodeEntryField(closure, ebx, eax); |
| 1000 __ jmp(entry); | 1004 __ jmp(entry); |
| 1001 | 1005 |
| 1002 __ bind(&gotta_call_runtime); | 1006 __ bind(&gotta_call_runtime); |
| 1003 __ pop(closure); | 1007 __ pop(closure); |
| 1004 __ pop(new_target); | 1008 __ pop(new_target); |
| 1005 __ bind(&gotta_call_runtime_no_stack); | 1009 __ bind(&gotta_call_runtime_no_stack); |
| 1006 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 1010 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
| 1007 GenerateTailCallToReturnedCode(masm); | 1011 GenerateTailCallToReturnedCode(masm); |
| 1008 } | 1012 } |
| 1009 | 1013 |
| (...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2813 | 2817 |
| 2814 __ bind(&ok); | 2818 __ bind(&ok); |
| 2815 __ ret(0); | 2819 __ ret(0); |
| 2816 } | 2820 } |
| 2817 | 2821 |
| 2818 #undef __ | 2822 #undef __ |
| 2819 } // namespace internal | 2823 } // namespace internal |
| 2820 } // namespace v8 | 2824 } // namespace v8 |
| 2821 | 2825 |
| 2822 #endif // V8_TARGET_ARCH_IA32 | 2826 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |