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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 __ cmp(index, Immediate(Smi::FromInt(1))); | 1154 __ cmp(index, Immediate(Smi::FromInt(1))); |
1155 __ j(greater, &loop_top); | 1155 __ j(greater, &loop_top); |
1156 | 1156 |
1157 // We found neither literals nor code. | 1157 // We found neither literals nor code. |
1158 __ jmp(&gotta_call_runtime); | 1158 __ jmp(&gotta_call_runtime); |
1159 | 1159 |
1160 __ bind(&try_shared); | 1160 __ bind(&try_shared); |
1161 __ pop(closure); | 1161 __ pop(closure); |
1162 __ pop(new_target); | 1162 __ pop(new_target); |
1163 __ pop(argument_count); | 1163 __ pop(argument_count); |
| 1164 __ mov(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
| 1165 // Is the shared function marked for optimization? |
| 1166 __ testb( |
| 1167 FieldOperand(entry, |
| 1168 SharedFunctionInfo::kWasMarkedForOptimizationByteOffset), |
| 1169 Immediate( |
| 1170 1 << SharedFunctionInfo::kWasMarkedForOptimizationBitWithinByte)); |
| 1171 __ j(not_zero, &gotta_call_runtime_no_stack); |
1164 // Is the full code valid? | 1172 // Is the full code valid? |
1165 __ mov(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | |
1166 __ mov(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); | 1173 __ mov(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); |
1167 __ mov(ebx, FieldOperand(entry, Code::kFlagsOffset)); | 1174 __ mov(ebx, FieldOperand(entry, Code::kFlagsOffset)); |
1168 __ and_(ebx, Code::KindField::kMask); | 1175 __ and_(ebx, Code::KindField::kMask); |
1169 __ shr(ebx, Code::KindField::kShift); | 1176 __ shr(ebx, Code::KindField::kShift); |
1170 __ cmp(ebx, Immediate(Code::BUILTIN)); | 1177 __ cmp(ebx, Immediate(Code::BUILTIN)); |
1171 __ j(equal, &gotta_call_runtime_no_stack); | 1178 __ j(equal, &gotta_call_runtime_no_stack); |
1172 // Yes, install the full code. | 1179 // Yes, install the full code. |
1173 __ lea(entry, FieldOperand(entry, Code::kHeaderSize)); | 1180 __ lea(entry, FieldOperand(entry, Code::kHeaderSize)); |
1174 __ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); | 1181 __ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); |
1175 __ RecordWriteCodeEntryField(closure, entry, ebx); | 1182 __ RecordWriteCodeEntryField(closure, entry, ebx); |
(...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3150 | 3157 |
3151 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3158 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3152 Generate_OnStackReplacementHelper(masm, true); | 3159 Generate_OnStackReplacementHelper(masm, true); |
3153 } | 3160 } |
3154 | 3161 |
3155 #undef __ | 3162 #undef __ |
3156 } // namespace internal | 3163 } // namespace internal |
3157 } // namespace v8 | 3164 } // namespace v8 |
3158 | 3165 |
3159 #endif // V8_TARGET_ARCH_X87 | 3166 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |