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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 1001 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
1002 __ bind(&bytecode_array_loaded); | 1002 __ bind(&bytecode_array_loaded); |
1003 | 1003 |
1004 // Check whether we should continue to use the interpreter. | 1004 // Check whether we should continue to use the interpreter. |
1005 Label switch_to_different_code_kind; | 1005 Label switch_to_different_code_kind; |
1006 __ ld(a0, FieldMemOperand(a0, SharedFunctionInfo::kCodeOffset)); | 1006 __ ld(a0, FieldMemOperand(a0, SharedFunctionInfo::kCodeOffset)); |
1007 __ Branch(&switch_to_different_code_kind, ne, a0, | 1007 __ Branch(&switch_to_different_code_kind, ne, a0, |
1008 Operand(masm->CodeObject())); // Self-reference to this code. | 1008 Operand(masm->CodeObject())); // Self-reference to this code. |
1009 | 1009 |
1010 // Increment invocation count for the function. | 1010 // Increment invocation count for the function. |
1011 __ ld(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset)); | 1011 __ ld(a0, FieldMemOperand(a1, JSFunction::kFeedbackVectorOffset)); |
1012 __ ld(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset)); | |
1013 __ ld(a4, FieldMemOperand( | 1012 __ ld(a4, FieldMemOperand( |
1014 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 1013 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
1015 TypeFeedbackVector::kHeaderSize)); | 1014 TypeFeedbackVector::kHeaderSize)); |
1016 __ Daddu(a4, a4, Operand(Smi::FromInt(1))); | 1015 __ Daddu(a4, a4, Operand(Smi::FromInt(1))); |
1017 __ sd(a4, FieldMemOperand( | 1016 __ sd(a4, FieldMemOperand( |
1018 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 1017 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
1019 TypeFeedbackVector::kHeaderSize)); | 1018 TypeFeedbackVector::kHeaderSize)); |
1020 | 1019 |
1021 // Check function data field is actually a BytecodeArray object. | 1020 // Check function data field is actually a BytecodeArray object. |
1022 if (FLAG_debug_code) { | 1021 if (FLAG_debug_code) { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 Register temp = a1; | 1367 Register temp = a1; |
1369 Register array_pointer = a5; | 1368 Register array_pointer = a5; |
1370 | 1369 |
1371 // Does the native context match? | 1370 // Does the native context match? |
1372 __ SmiScale(at, index, kPointerSizeLog2); | 1371 __ SmiScale(at, index, kPointerSizeLog2); |
1373 __ Daddu(array_pointer, map, Operand(at)); | 1372 __ Daddu(array_pointer, map, Operand(at)); |
1374 __ ld(temp, FieldMemOperand(array_pointer, | 1373 __ ld(temp, FieldMemOperand(array_pointer, |
1375 SharedFunctionInfo::kOffsetToPreviousContext)); | 1374 SharedFunctionInfo::kOffsetToPreviousContext)); |
1376 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1375 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
1377 __ Branch(&loop_bottom, ne, temp, Operand(native_context)); | 1376 __ Branch(&loop_bottom, ne, temp, Operand(native_context)); |
1378 // Literals available? | 1377 // Feedback vector available? |
1379 __ ld(temp, FieldMemOperand(array_pointer, | 1378 __ ld(temp, FieldMemOperand(array_pointer, |
1380 SharedFunctionInfo::kOffsetToPreviousLiterals)); | 1379 SharedFunctionInfo::kOffsetToPreviousLiterals)); |
1381 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1380 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
1382 __ JumpIfSmi(temp, &gotta_call_runtime); | 1381 __ JumpIfSmi(temp, &gotta_call_runtime); |
1383 | 1382 |
1384 // Save the literals in the closure. | 1383 // Save the feedback vector in the closure. |
1385 __ ld(a4, MemOperand(sp, 0)); | 1384 __ ld(a4, MemOperand(sp, 0)); |
1386 __ sd(temp, FieldMemOperand(a4, JSFunction::kLiteralsOffset)); | 1385 __ sd(temp, FieldMemOperand(a4, JSFunction::kFeedbackVectorOffset)); |
1387 __ push(index); | 1386 __ push(index); |
1388 __ RecordWriteField(a4, JSFunction::kLiteralsOffset, temp, index, | 1387 __ RecordWriteField(a4, JSFunction::kFeedbackVectorOffset, temp, index, |
1389 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 1388 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
1390 OMIT_SMI_CHECK); | 1389 OMIT_SMI_CHECK); |
1391 __ pop(index); | 1390 __ pop(index); |
1392 | 1391 |
1393 // Code available? | 1392 // Code available? |
1394 Register entry = a4; | 1393 Register entry = a4; |
1395 __ ld(entry, | 1394 __ ld(entry, |
1396 FieldMemOperand(array_pointer, | 1395 FieldMemOperand(array_pointer, |
1397 SharedFunctionInfo::kOffsetToPreviousCachedCode)); | 1396 SharedFunctionInfo::kOffsetToPreviousCachedCode)); |
1398 __ ld(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); | 1397 __ ld(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3219 __ break_(0xCC); | 3218 __ break_(0xCC); |
3220 } | 3219 } |
3221 } | 3220 } |
3222 | 3221 |
3223 #undef __ | 3222 #undef __ |
3224 | 3223 |
3225 } // namespace internal | 3224 } // namespace internal |
3226 } // namespace v8 | 3225 } // namespace v8 |
3227 | 3226 |
3228 #endif // V8_TARGET_ARCH_MIPS64 | 3227 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |