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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.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 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 __ ldr(kInterpreterBytecodeArrayRegister, | 1009 __ ldr(kInterpreterBytecodeArrayRegister, |
1010 FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex), ne); | 1010 FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex), ne); |
1011 | 1011 |
1012 // Check whether we should continue to use the interpreter. | 1012 // Check whether we should continue to use the interpreter. |
1013 Label switch_to_different_code_kind; | 1013 Label switch_to_different_code_kind; |
1014 __ ldr(r0, FieldMemOperand(r0, SharedFunctionInfo::kCodeOffset)); | 1014 __ ldr(r0, FieldMemOperand(r0, SharedFunctionInfo::kCodeOffset)); |
1015 __ cmp(r0, Operand(masm->CodeObject())); // Self-reference to this code. | 1015 __ cmp(r0, Operand(masm->CodeObject())); // Self-reference to this code. |
1016 __ b(ne, &switch_to_different_code_kind); | 1016 __ b(ne, &switch_to_different_code_kind); |
1017 | 1017 |
1018 // Increment invocation count for the function. | 1018 // Increment invocation count for the function. |
1019 __ ldr(r2, FieldMemOperand(r1, JSFunction::kLiteralsOffset)); | 1019 __ ldr(r2, FieldMemOperand(r1, JSFunction::kFeedbackVectorOffset)); |
1020 __ ldr(r2, FieldMemOperand(r2, LiteralsArray::kFeedbackVectorOffset)); | |
1021 __ ldr(r9, FieldMemOperand( | 1020 __ ldr(r9, FieldMemOperand( |
1022 r2, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 1021 r2, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
1023 TypeFeedbackVector::kHeaderSize)); | 1022 TypeFeedbackVector::kHeaderSize)); |
1024 __ add(r9, r9, Operand(Smi::FromInt(1))); | 1023 __ add(r9, r9, Operand(Smi::FromInt(1))); |
1025 __ str(r9, FieldMemOperand( | 1024 __ str(r9, FieldMemOperand( |
1026 r2, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 1025 r2, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
1027 TypeFeedbackVector::kHeaderSize)); | 1026 TypeFeedbackVector::kHeaderSize)); |
1028 | 1027 |
1029 // Check function data field is actually a BytecodeArray object. | 1028 // Check function data field is actually a BytecodeArray object. |
1030 if (FLAG_debug_code) { | 1029 if (FLAG_debug_code) { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1367 Register temp = r1; | 1366 Register temp = r1; |
1368 Register array_pointer = r5; | 1367 Register array_pointer = r5; |
1369 | 1368 |
1370 // Does the native context match? | 1369 // Does the native context match? |
1371 __ add(array_pointer, map, Operand::PointerOffsetFromSmiKey(index)); | 1370 __ add(array_pointer, map, Operand::PointerOffsetFromSmiKey(index)); |
1372 __ ldr(temp, FieldMemOperand(array_pointer, | 1371 __ ldr(temp, FieldMemOperand(array_pointer, |
1373 SharedFunctionInfo::kOffsetToPreviousContext)); | 1372 SharedFunctionInfo::kOffsetToPreviousContext)); |
1374 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1373 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
1375 __ cmp(temp, native_context); | 1374 __ cmp(temp, native_context); |
1376 __ b(ne, &loop_bottom); | 1375 __ b(ne, &loop_bottom); |
1377 // Literals available? | 1376 // Feedback vector available? |
1378 __ ldr(temp, FieldMemOperand(array_pointer, | 1377 __ ldr(temp, FieldMemOperand(array_pointer, |
1379 SharedFunctionInfo::kOffsetToPreviousLiterals)); | 1378 SharedFunctionInfo::kOffsetToPreviousLiterals)); |
1380 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1379 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
1381 __ JumpIfSmi(temp, &gotta_call_runtime); | 1380 __ JumpIfSmi(temp, &gotta_call_runtime); |
1382 | 1381 |
1383 // Save the literals in the closure. | 1382 // Save the feedback vector in the closure. |
1384 __ ldr(r4, MemOperand(sp, 0)); | 1383 __ ldr(r4, MemOperand(sp, 0)); |
1385 __ str(temp, FieldMemOperand(r4, JSFunction::kLiteralsOffset)); | 1384 __ str(temp, FieldMemOperand(r4, JSFunction::kFeedbackVectorOffset)); |
1386 __ push(index); | 1385 __ push(index); |
1387 __ RecordWriteField(r4, JSFunction::kLiteralsOffset, temp, index, | 1386 __ RecordWriteField(r4, JSFunction::kFeedbackVectorOffset, temp, index, |
1388 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 1387 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
1389 OMIT_SMI_CHECK); | 1388 OMIT_SMI_CHECK); |
1390 __ pop(index); | 1389 __ pop(index); |
1391 | 1390 |
1392 // Code available? | 1391 // Code available? |
1393 Register entry = r4; | 1392 Register entry = r4; |
1394 __ ldr(entry, | 1393 __ ldr(entry, |
1395 FieldMemOperand(array_pointer, | 1394 FieldMemOperand(array_pointer, |
1396 SharedFunctionInfo::kOffsetToPreviousCachedCode)); | 1395 SharedFunctionInfo::kOffsetToPreviousCachedCode)); |
1397 __ ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); | 1396 __ ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); |
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3122 __ bkpt(0); | 3121 __ bkpt(0); |
3123 } | 3122 } |
3124 } | 3123 } |
3125 | 3124 |
3126 #undef __ | 3125 #undef __ |
3127 | 3126 |
3128 } // namespace internal | 3127 } // namespace internal |
3129 } // namespace v8 | 3128 } // namespace v8 |
3130 | 3129 |
3131 #endif // V8_TARGET_ARCH_ARM | 3130 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |