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 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 | 1115 |
1116 __ bind(&try_shared); | 1116 __ bind(&try_shared); |
1117 __ pop(closure); | 1117 __ pop(closure); |
1118 __ pop(new_target); | 1118 __ pop(new_target); |
1119 __ pop(argument_count); | 1119 __ pop(argument_count); |
1120 __ mov(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1120 __ mov(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
1121 // Is the shared function marked for tier up? | 1121 // Is the shared function marked for tier up? |
1122 __ test_b(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset), | 1122 __ test_b(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset), |
1123 Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte)); | 1123 Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte)); |
1124 __ j(not_zero, &gotta_call_runtime_no_stack); | 1124 __ j(not_zero, &gotta_call_runtime_no_stack); |
1125 // Is the full code valid? | 1125 |
| 1126 // If SFI points to anything other than CompileLazy, install that. |
1126 __ mov(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); | 1127 __ mov(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); |
1127 __ mov(ebx, FieldOperand(entry, Code::kFlagsOffset)); | 1128 __ Move(ebx, masm->CodeObject()); |
1128 __ and_(ebx, Code::KindField::kMask); | 1129 __ cmp(entry, ebx); |
1129 __ shr(ebx, Code::KindField::kShift); | |
1130 __ cmp(ebx, Immediate(Code::BUILTIN)); | |
1131 __ j(equal, &gotta_call_runtime_no_stack); | 1130 __ j(equal, &gotta_call_runtime_no_stack); |
1132 // Yes, install the full code. | 1131 |
| 1132 // Install the SFI's code entry. |
1133 __ lea(entry, FieldOperand(entry, Code::kHeaderSize)); | 1133 __ lea(entry, FieldOperand(entry, Code::kHeaderSize)); |
1134 __ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); | 1134 __ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); |
1135 __ RecordWriteCodeEntryField(closure, entry, ebx); | 1135 __ RecordWriteCodeEntryField(closure, entry, ebx); |
1136 __ jmp(entry); | 1136 __ jmp(entry); |
1137 | 1137 |
1138 __ bind(&gotta_call_runtime); | 1138 __ bind(&gotta_call_runtime); |
1139 __ pop(closure); | 1139 __ pop(closure); |
1140 __ pop(new_target); | 1140 __ pop(new_target); |
1141 __ pop(argument_count); | 1141 __ pop(argument_count); |
1142 __ bind(&gotta_call_runtime_no_stack); | 1142 __ bind(&gotta_call_runtime_no_stack); |
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3109 | 3109 |
3110 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3110 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3111 Generate_OnStackReplacementHelper(masm, true); | 3111 Generate_OnStackReplacementHelper(masm, true); |
3112 } | 3112 } |
3113 | 3113 |
3114 #undef __ | 3114 #undef __ |
3115 } // namespace internal | 3115 } // namespace internal |
3116 } // namespace v8 | 3116 } // namespace v8 |
3117 | 3117 |
3118 #endif // V8_TARGET_ARCH_IA32 | 3118 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |