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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 | 1114 |
1115 __ bind(&loop_bottom); | 1115 __ bind(&loop_bottom); |
1116 __ subl(index, Immediate(SharedFunctionInfo::kEntryLength)); | 1116 __ subl(index, Immediate(SharedFunctionInfo::kEntryLength)); |
1117 __ cmpl(index, Immediate(1)); | 1117 __ cmpl(index, Immediate(1)); |
1118 __ j(greater, &loop_top); | 1118 __ j(greater, &loop_top); |
1119 | 1119 |
1120 // We found neither literals nor code. | 1120 // We found neither literals nor code. |
1121 __ jmp(&gotta_call_runtime); | 1121 __ jmp(&gotta_call_runtime); |
1122 | 1122 |
1123 __ bind(&try_shared); | 1123 __ bind(&try_shared); |
| 1124 __ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
| 1125 // Is the shared function marked for optimization? |
| 1126 __ testb( |
| 1127 FieldOperand(entry, |
| 1128 SharedFunctionInfo::kWasMarkedForOptimizationByteOffset), |
| 1129 Immediate( |
| 1130 1 << SharedFunctionInfo::kWasMarkedForOptimizationBitWithinByte)); |
| 1131 __ j(not_zero, &gotta_call_runtime); |
1124 // Is the full code valid? | 1132 // Is the full code valid? |
1125 __ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | |
1126 __ movp(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); | 1133 __ movp(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); |
1127 __ movl(rbx, FieldOperand(entry, Code::kFlagsOffset)); | 1134 __ movl(rbx, FieldOperand(entry, Code::kFlagsOffset)); |
1128 __ andl(rbx, Immediate(Code::KindField::kMask)); | 1135 __ andl(rbx, Immediate(Code::KindField::kMask)); |
1129 __ shrl(rbx, Immediate(Code::KindField::kShift)); | 1136 __ shrl(rbx, Immediate(Code::KindField::kShift)); |
1130 __ cmpl(rbx, Immediate(Code::BUILTIN)); | 1137 __ cmpl(rbx, Immediate(Code::BUILTIN)); |
1131 __ j(equal, &gotta_call_runtime); | 1138 __ j(equal, &gotta_call_runtime); |
1132 // Yes, install the full code. | 1139 // Yes, install the full code. |
1133 __ leap(entry, FieldOperand(entry, Code::kHeaderSize)); | 1140 __ leap(entry, FieldOperand(entry, Code::kHeaderSize)); |
1134 __ movp(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); | 1141 __ movp(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); |
1135 __ RecordWriteCodeEntryField(closure, entry, r15); | 1142 __ RecordWriteCodeEntryField(closure, entry, r15); |
(...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3073 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3080 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3074 Generate_OnStackReplacementHelper(masm, true); | 3081 Generate_OnStackReplacementHelper(masm, true); |
3075 } | 3082 } |
3076 | 3083 |
3077 #undef __ | 3084 #undef __ |
3078 | 3085 |
3079 } // namespace internal | 3086 } // namespace internal |
3080 } // namespace v8 | 3087 } // namespace v8 |
3081 | 3088 |
3082 #endif // V8_TARGET_ARCH_X64 | 3089 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |