| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 6 | 6 |
| 7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/counters.h" | 9 #include "src/counters.h" |
| 10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 __ ldr( | 1044 __ ldr( |
| 1045 optimized_code_entry, | 1045 optimized_code_entry, |
| 1046 FieldMemOperand(r0, FeedbackVector::kOptimizedCodeIndex * kPointerSize + | 1046 FieldMemOperand(r0, FeedbackVector::kOptimizedCodeIndex * kPointerSize + |
| 1047 FeedbackVector::kHeaderSize)); | 1047 FeedbackVector::kHeaderSize)); |
| 1048 __ ldr(optimized_code_entry, | 1048 __ ldr(optimized_code_entry, |
| 1049 FieldMemOperand(optimized_code_entry, WeakCell::kValueOffset)); | 1049 FieldMemOperand(optimized_code_entry, WeakCell::kValueOffset)); |
| 1050 __ JumpIfNotSmi(optimized_code_entry, &switch_to_optimized_code); | 1050 __ JumpIfNotSmi(optimized_code_entry, &switch_to_optimized_code); |
| 1051 | 1051 |
| 1052 // Get the bytecode array from the function object (or from the DebugInfo if | 1052 // Get the bytecode array from the function object (or from the DebugInfo if |
| 1053 // it is present) and load it into kInterpreterBytecodeArrayRegister. | 1053 // it is present) and load it into kInterpreterBytecodeArrayRegister. |
| 1054 Label maybe_load_debug_bytecode_array, bytecode_array_loaded; |
| 1054 __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 1055 __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
| 1055 Register debug_info = kInterpreterBytecodeArrayRegister; | |
| 1056 DCHECK(!debug_info.is(r0)); | |
| 1057 __ ldr(debug_info, FieldMemOperand(r0, SharedFunctionInfo::kDebugInfoOffset)); | |
| 1058 __ SmiTst(debug_info); | |
| 1059 // Load original bytecode array or the debug copy. | |
| 1060 __ ldr(kInterpreterBytecodeArrayRegister, | 1056 __ ldr(kInterpreterBytecodeArrayRegister, |
| 1061 FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset), eq); | 1057 FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset)); |
| 1062 __ ldr(kInterpreterBytecodeArrayRegister, | 1058 __ ldr(r2, FieldMemOperand(r0, SharedFunctionInfo::kDebugInfoOffset)); |
| 1063 FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex), ne); | 1059 __ SmiTst(r2); |
| 1060 __ b(ne, &maybe_load_debug_bytecode_array); |
| 1061 __ bind(&bytecode_array_loaded); |
| 1064 | 1062 |
| 1065 // Check whether we should continue to use the interpreter. | 1063 // Check whether we should continue to use the interpreter. |
| 1066 // TODO(rmcilroy) Remove self healing once liveedit only has to deal with | 1064 // TODO(rmcilroy) Remove self healing once liveedit only has to deal with |
| 1067 // Ignition bytecode. | 1065 // Ignition bytecode. |
| 1068 Label switch_to_different_code_kind; | 1066 Label switch_to_different_code_kind; |
| 1069 __ ldr(r0, FieldMemOperand(r0, SharedFunctionInfo::kCodeOffset)); | 1067 __ ldr(r0, FieldMemOperand(r0, SharedFunctionInfo::kCodeOffset)); |
| 1070 __ cmp(r0, Operand(masm->CodeObject())); // Self-reference to this code. | 1068 __ cmp(r0, Operand(masm->CodeObject())); // Self-reference to this code. |
| 1071 __ b(ne, &switch_to_different_code_kind); | 1069 __ b(ne, &switch_to_different_code_kind); |
| 1072 | 1070 |
| 1073 // Increment invocation count for the function. | 1071 // Increment invocation count for the function. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 kInterpreterBytecodeOffsetRegister)); | 1141 kInterpreterBytecodeOffsetRegister)); |
| 1144 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, | 1142 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, |
| 1145 kPointerSizeLog2)); | 1143 kPointerSizeLog2)); |
| 1146 __ Call(ip); | 1144 __ Call(ip); |
| 1147 masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset()); | 1145 masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset()); |
| 1148 | 1146 |
| 1149 // The return value is in r0. | 1147 // The return value is in r0. |
| 1150 LeaveInterpreterFrame(masm, r2); | 1148 LeaveInterpreterFrame(masm, r2); |
| 1151 __ Jump(lr); | 1149 __ Jump(lr); |
| 1152 | 1150 |
| 1151 // Load debug copy of the bytecode array if it exists. |
| 1152 // kInterpreterBytecodeArrayRegister is already loaded with |
| 1153 // SharedFunctionInfo::kFunctionDataOffset. |
| 1154 __ bind(&maybe_load_debug_bytecode_array); |
| 1155 __ ldr(r9, FieldMemOperand(r2, DebugInfo::kFlagsOffset)); |
| 1156 __ SmiUntag(r9); |
| 1157 __ tst(r9, Operand(DebugInfo::kHasBreakInfo)); |
| 1158 __ ldr(kInterpreterBytecodeArrayRegister, |
| 1159 FieldMemOperand(r2, DebugInfo::kDebugBytecodeArrayOffset), ne); |
| 1160 __ b(&bytecode_array_loaded); |
| 1161 |
| 1153 // If the shared code is no longer this entry trampoline, then the underlying | 1162 // If the shared code is no longer this entry trampoline, then the underlying |
| 1154 // function has been switched to a different kind of code and we heal the | 1163 // function has been switched to a different kind of code and we heal the |
| 1155 // closure by switching the code entry field over to the new code as well. | 1164 // closure by switching the code entry field over to the new code as well. |
| 1156 __ bind(&switch_to_different_code_kind); | 1165 __ bind(&switch_to_different_code_kind); |
| 1157 __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 1166 __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
| 1158 __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 1167 __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
| 1159 __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kCodeOffset)); | 1168 __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kCodeOffset)); |
| 1160 __ add(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1169 __ add(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1161 __ str(r4, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 1170 __ str(r4, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
| 1162 __ RecordWriteCodeEntryField(r1, r4, r5); | 1171 __ RecordWriteCodeEntryField(r1, r4, r5); |
| (...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3053 } | 3062 } |
| 3054 // Now jump to the instructions of the returned code object. | 3063 // Now jump to the instructions of the returned code object. |
| 3055 __ Jump(r8); | 3064 __ Jump(r8); |
| 3056 } | 3065 } |
| 3057 #undef __ | 3066 #undef __ |
| 3058 | 3067 |
| 3059 } // namespace internal | 3068 } // namespace internal |
| 3060 } // namespace v8 | 3069 } // namespace v8 |
| 3061 | 3070 |
| 3062 #endif // V8_TARGET_ARCH_ARM | 3071 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |