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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 __ lw(kInterpreterBytecodeArrayRegister, | 1044 __ lw(kInterpreterBytecodeArrayRegister, |
1045 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 1045 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
1046 __ bind(&bytecode_array_loaded); | 1046 __ bind(&bytecode_array_loaded); |
1047 | 1047 |
1048 // Check whether we should continue to use the interpreter. | 1048 // Check whether we should continue to use the interpreter. |
1049 Label switch_to_different_code_kind; | 1049 Label switch_to_different_code_kind; |
1050 __ lw(a0, FieldMemOperand(a0, SharedFunctionInfo::kCodeOffset)); | 1050 __ lw(a0, FieldMemOperand(a0, SharedFunctionInfo::kCodeOffset)); |
1051 __ Branch(&switch_to_different_code_kind, ne, a0, | 1051 __ Branch(&switch_to_different_code_kind, ne, a0, |
1052 Operand(masm->CodeObject())); // Self-reference to this code. | 1052 Operand(masm->CodeObject())); // Self-reference to this code. |
1053 | 1053 |
| 1054 // Increment invocation count for the function. |
| 1055 __ lw(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset)); |
| 1056 __ lw(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset)); |
| 1057 __ lw(t0, FieldMemOperand( |
| 1058 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 1059 TypeFeedbackVector::kHeaderSize)); |
| 1060 __ Addu(t0, t0, Operand(Smi::FromInt(1))); |
| 1061 __ sw(t0, FieldMemOperand( |
| 1062 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 1063 TypeFeedbackVector::kHeaderSize)); |
| 1064 |
1054 // Check function data field is actually a BytecodeArray object. | 1065 // Check function data field is actually a BytecodeArray object. |
1055 if (FLAG_debug_code) { | 1066 if (FLAG_debug_code) { |
1056 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); | 1067 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); |
1057 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, | 1068 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, |
1058 Operand(zero_reg)); | 1069 Operand(zero_reg)); |
1059 __ GetObjectType(kInterpreterBytecodeArrayRegister, t0, t0); | 1070 __ GetObjectType(kInterpreterBytecodeArrayRegister, t0, t0); |
1060 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, | 1071 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, |
1061 Operand(BYTECODE_ARRAY_TYPE)); | 1072 Operand(BYTECODE_ARRAY_TYPE)); |
1062 } | 1073 } |
1063 | 1074 |
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3030 __ break_(0xCC); | 3041 __ break_(0xCC); |
3031 } | 3042 } |
3032 } | 3043 } |
3033 | 3044 |
3034 #undef __ | 3045 #undef __ |
3035 | 3046 |
3036 } // namespace internal | 3047 } // namespace internal |
3037 } // namespace v8 | 3048 } // namespace v8 |
3038 | 3049 |
3039 #endif // V8_TARGET_ARCH_MIPS | 3050 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |