OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64-inl.h" | 8 #include "src/arm64/macro-assembler-arm64-inl.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/counters.h" | 10 #include "src/counters.h" |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 __ Ldr( | 1067 __ Ldr( |
1068 optimized_code_entry, | 1068 optimized_code_entry, |
1069 FieldMemOperand(x0, FeedbackVector::kOptimizedCodeIndex * kPointerSize + | 1069 FieldMemOperand(x0, FeedbackVector::kOptimizedCodeIndex * kPointerSize + |
1070 FeedbackVector::kHeaderSize)); | 1070 FeedbackVector::kHeaderSize)); |
1071 __ Ldr(optimized_code_entry, | 1071 __ Ldr(optimized_code_entry, |
1072 FieldMemOperand(optimized_code_entry, WeakCell::kValueOffset)); | 1072 FieldMemOperand(optimized_code_entry, WeakCell::kValueOffset)); |
1073 __ JumpIfNotSmi(optimized_code_entry, &switch_to_optimized_code); | 1073 __ JumpIfNotSmi(optimized_code_entry, &switch_to_optimized_code); |
1074 | 1074 |
1075 // Get the bytecode array from the function object (or from the DebugInfo if | 1075 // Get the bytecode array from the function object (or from the DebugInfo if |
1076 // it is present) and load it into kInterpreterBytecodeArrayRegister. | 1076 // it is present) and load it into kInterpreterBytecodeArrayRegister. |
| 1077 Label maybe_load_debug_bytecode_array, bytecode_array_loaded; |
1077 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 1078 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
1078 Register debug_info = kInterpreterBytecodeArrayRegister; | |
1079 Label load_debug_bytecode_array, bytecode_array_loaded; | |
1080 DCHECK(!debug_info.is(x0)); | |
1081 __ Ldr(debug_info, FieldMemOperand(x0, SharedFunctionInfo::kDebugInfoOffset)); | |
1082 __ JumpIfNotSmi(debug_info, &load_debug_bytecode_array); | |
1083 __ Ldr(kInterpreterBytecodeArrayRegister, | 1079 __ Ldr(kInterpreterBytecodeArrayRegister, |
1084 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); | 1080 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); |
| 1081 __ Ldr(x11, FieldMemOperand(x0, SharedFunctionInfo::kDebugInfoOffset)); |
| 1082 __ JumpIfNotSmi(x11, &maybe_load_debug_bytecode_array); |
1085 __ Bind(&bytecode_array_loaded); | 1083 __ Bind(&bytecode_array_loaded); |
1086 | 1084 |
1087 // Check whether we should continue to use the interpreter. | 1085 // Check whether we should continue to use the interpreter. |
1088 // TODO(rmcilroy) Remove self healing once liveedit only has to deal with | 1086 // TODO(rmcilroy) Remove self healing once liveedit only has to deal with |
1089 // Ignition bytecode. | 1087 // Ignition bytecode. |
1090 Label switch_to_different_code_kind; | 1088 Label switch_to_different_code_kind; |
1091 __ Ldr(x0, FieldMemOperand(x0, SharedFunctionInfo::kCodeOffset)); | 1089 __ Ldr(x0, FieldMemOperand(x0, SharedFunctionInfo::kCodeOffset)); |
1092 __ Cmp(x0, Operand(masm->CodeObject())); // Self-reference to this code. | 1090 __ Cmp(x0, Operand(masm->CodeObject())); // Self-reference to this code. |
1093 __ B(ne, &switch_to_different_code_kind); | 1091 __ B(ne, &switch_to_different_code_kind); |
1094 | 1092 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 kInterpreterBytecodeOffsetRegister)); | 1161 kInterpreterBytecodeOffsetRegister)); |
1164 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); | 1162 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); |
1165 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); | 1163 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); |
1166 __ Call(ip0); | 1164 __ Call(ip0); |
1167 masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset()); | 1165 masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset()); |
1168 | 1166 |
1169 // The return value is in x0. | 1167 // The return value is in x0. |
1170 LeaveInterpreterFrame(masm, x2); | 1168 LeaveInterpreterFrame(masm, x2); |
1171 __ Ret(); | 1169 __ Ret(); |
1172 | 1170 |
1173 // Load debug copy of the bytecode array. | 1171 // Load debug copy of the bytecode array if it exists. |
1174 __ Bind(&load_debug_bytecode_array); | 1172 // kInterpreterBytecodeArrayRegister is already loaded with |
| 1173 // SharedFunctionInfo::kFunctionDataOffset. |
| 1174 __ Bind(&maybe_load_debug_bytecode_array); |
| 1175 __ Ldr(x10, FieldMemOperand(x11, DebugInfo::kFlagsOffset)); |
| 1176 __ SmiUntag(x10); |
| 1177 __ TestAndBranchIfAllClear(x10, DebugInfo::kHasBreakInfo, |
| 1178 &bytecode_array_loaded); |
1175 __ Ldr(kInterpreterBytecodeArrayRegister, | 1179 __ Ldr(kInterpreterBytecodeArrayRegister, |
1176 FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex)); | 1180 FieldMemOperand(x11, DebugInfo::kDebugBytecodeArrayOffset)); |
1177 __ B(&bytecode_array_loaded); | 1181 __ B(&bytecode_array_loaded); |
1178 | 1182 |
1179 // If the shared code is no longer this entry trampoline, then the underlying | 1183 // If the shared code is no longer this entry trampoline, then the underlying |
1180 // function has been switched to a different kind of code and we heal the | 1184 // function has been switched to a different kind of code and we heal the |
1181 // closure by switching the code entry field over to the new code as well. | 1185 // closure by switching the code entry field over to the new code as well. |
1182 __ bind(&switch_to_different_code_kind); | 1186 __ bind(&switch_to_different_code_kind); |
1183 __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 1187 __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
1184 __ Ldr(x7, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 1188 __ Ldr(x7, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
1185 __ Ldr(x7, FieldMemOperand(x7, SharedFunctionInfo::kCodeOffset)); | 1189 __ Ldr(x7, FieldMemOperand(x7, SharedFunctionInfo::kCodeOffset)); |
1186 __ Add(x7, x7, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1190 __ Add(x7, x7, Operand(Code::kHeaderSize - kHeapObjectTag)); |
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3214 // Now jump to the instructions of the returned code object. | 3218 // Now jump to the instructions of the returned code object. |
3215 __ Jump(x8); | 3219 __ Jump(x8); |
3216 } | 3220 } |
3217 | 3221 |
3218 #undef __ | 3222 #undef __ |
3219 | 3223 |
3220 } // namespace internal | 3224 } // namespace internal |
3221 } // namespace v8 | 3225 } // namespace v8 |
3222 | 3226 |
3223 #endif // V8_TARGET_ARCH_ARM | 3227 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |