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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 __ mov(kInterpreterBytecodeArrayRegister, | 584 __ mov(kInterpreterBytecodeArrayRegister, |
585 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); | 585 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); |
586 __ bind(&bytecode_array_loaded); | 586 __ bind(&bytecode_array_loaded); |
587 | 587 |
588 // Check whether we should continue to use the interpreter. | 588 // Check whether we should continue to use the interpreter. |
589 Label switch_to_different_code_kind; | 589 Label switch_to_different_code_kind; |
590 __ Move(ecx, masm->CodeObject()); // Self-reference to this code. | 590 __ Move(ecx, masm->CodeObject()); // Self-reference to this code. |
591 __ cmp(ecx, FieldOperand(eax, SharedFunctionInfo::kCodeOffset)); | 591 __ cmp(ecx, FieldOperand(eax, SharedFunctionInfo::kCodeOffset)); |
592 __ j(not_equal, &switch_to_different_code_kind); | 592 __ j(not_equal, &switch_to_different_code_kind); |
593 | 593 |
| 594 // Increment invocation count for the function. |
| 595 __ EmitLoadTypeFeedbackVector(ecx); |
| 596 __ add(FieldOperand(ecx, |
| 597 TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 598 TypeFeedbackVector::kHeaderSize), |
| 599 Immediate(Smi::FromInt(1))); |
| 600 |
594 // Check function data field is actually a BytecodeArray object. | 601 // Check function data field is actually a BytecodeArray object. |
595 if (FLAG_debug_code) { | 602 if (FLAG_debug_code) { |
596 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); | 603 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); |
597 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, | 604 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, |
598 eax); | 605 eax); |
599 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 606 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
600 } | 607 } |
601 | 608 |
602 // Push bytecode array. | 609 // Push bytecode array. |
603 __ push(kInterpreterBytecodeArrayRegister); | 610 __ push(kInterpreterBytecodeArrayRegister); |
(...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3113 | 3120 |
3114 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3121 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3115 Generate_OnStackReplacementHelper(masm, true); | 3122 Generate_OnStackReplacementHelper(masm, true); |
3116 } | 3123 } |
3117 | 3124 |
3118 #undef __ | 3125 #undef __ |
3119 } // namespace internal | 3126 } // namespace internal |
3120 } // namespace v8 | 3127 } // namespace v8 |
3121 | 3128 |
3122 #endif // V8_TARGET_ARCH_X87 | 3129 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |