| 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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 __ j(equal, &bytecode_array_not_present); | 566 __ j(equal, &bytecode_array_not_present); |
| 567 if (FLAG_debug_code) { | 567 if (FLAG_debug_code) { |
| 568 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); | 568 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); |
| 569 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, | 569 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, |
| 570 eax); | 570 eax); |
| 571 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 571 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
| 572 } | 572 } |
| 573 | 573 |
| 574 // Push bytecode array. | 574 // Push bytecode array. |
| 575 __ push(kInterpreterBytecodeArrayRegister); | 575 __ push(kInterpreterBytecodeArrayRegister); |
| 576 // Push zero for bytecode array offset. | 576 // Push Smi tagged initial bytecode array offset. |
| 577 __ push(Immediate(0)); | 577 __ push(Immediate(Smi::FromInt(BytecodeArray::kHeaderSize - kHeapObjectTag))); |
| 578 | 578 |
| 579 // Allocate the local and temporary register file on the stack. | 579 // Allocate the local and temporary register file on the stack. |
| 580 { | 580 { |
| 581 // Load frame size from the BytecodeArray object. | 581 // Load frame size from the BytecodeArray object. |
| 582 __ mov(ebx, FieldOperand(kInterpreterBytecodeArrayRegister, | 582 __ mov(ebx, FieldOperand(kInterpreterBytecodeArrayRegister, |
| 583 BytecodeArray::kFrameSizeOffset)); | 583 BytecodeArray::kFrameSizeOffset)); |
| 584 | 584 |
| 585 // Do a stack check to ensure we don't go over the limit. | 585 // Do a stack check to ensure we don't go over the limit. |
| 586 Label ok; | 586 Label ok; |
| 587 __ mov(ecx, esp); | 587 __ mov(ecx, esp); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 600 __ jmp(&loop_check); | 600 __ jmp(&loop_check); |
| 601 __ bind(&loop_header); | 601 __ bind(&loop_header); |
| 602 // TODO(rmcilroy): Consider doing more than one push per loop iteration. | 602 // TODO(rmcilroy): Consider doing more than one push per loop iteration. |
| 603 __ push(eax); | 603 __ push(eax); |
| 604 // Continue loop if not done. | 604 // Continue loop if not done. |
| 605 __ bind(&loop_check); | 605 __ bind(&loop_check); |
| 606 __ sub(ebx, Immediate(kPointerSize)); | 606 __ sub(ebx, Immediate(kPointerSize)); |
| 607 __ j(greater_equal, &loop_header); | 607 __ j(greater_equal, &loop_header); |
| 608 } | 608 } |
| 609 | 609 |
| 610 // Load accumulator, register file, bytecode offset, dispatch table into | 610 // Load accumulator, bytecode offset and dispatch table into registers. |
| 611 // registers. | |
| 612 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 611 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 613 __ mov(edx, ebp); | |
| 614 __ add(edx, Immediate(InterpreterFrameConstants::kRegisterFileFromFp)); | |
| 615 __ mov(kInterpreterBytecodeOffsetRegister, | 612 __ mov(kInterpreterBytecodeOffsetRegister, |
| 616 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 613 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 617 __ mov(kInterpreterDispatchTableRegister, | 614 __ mov(kInterpreterDispatchTableRegister, |
| 618 Immediate(ExternalReference::interpreter_dispatch_table_address( | 615 Immediate(ExternalReference::interpreter_dispatch_table_address( |
| 619 masm->isolate()))); | 616 masm->isolate()))); |
| 620 | 617 |
| 621 // Dispatch to the first bytecode handler for the function. | 618 // Dispatch to the first bytecode handler for the function. |
| 622 __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, | 619 __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, |
| 623 kInterpreterBytecodeOffsetRegister, times_1, 0)); | 620 kInterpreterBytecodeOffsetRegister, times_1, 0)); |
| 624 __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx, | 621 __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx, |
| (...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2935 // And "return" to the OSR entry point of the function. | 2932 // And "return" to the OSR entry point of the function. |
| 2936 __ ret(0); | 2933 __ ret(0); |
| 2937 } | 2934 } |
| 2938 | 2935 |
| 2939 | 2936 |
| 2940 #undef __ | 2937 #undef __ |
| 2941 } // namespace internal | 2938 } // namespace internal |
| 2942 } // namespace v8 | 2939 } // namespace v8 |
| 2943 | 2940 |
| 2944 #endif // V8_TARGET_ARCH_X87 | 2941 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |