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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 FrameScope frame_scope(masm, StackFrame::MANUAL); | 414 FrameScope frame_scope(masm, StackFrame::MANUAL); |
415 __ push(ebp); // Caller's frame pointer. | 415 __ push(ebp); // Caller's frame pointer. |
416 __ mov(ebp, esp); | 416 __ mov(ebp, esp); |
417 __ push(esi); // Callee's context. | 417 __ push(esi); // Callee's context. |
418 __ push(edi); // Callee's JS function. | 418 __ push(edi); // Callee's JS function. |
419 __ push(edx); // Callee's new target. | 419 __ push(edx); // Callee's new target. |
420 | 420 |
421 // Get the bytecode array from the function object and load the pointer to the | 421 // Get the bytecode array from the function object and load the pointer to the |
422 // first entry into edi (InterpreterBytecodeRegister). | 422 // first entry into edi (InterpreterBytecodeRegister). |
423 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 423 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 424 |
| 425 Label load_debug_bytecode_array, bytecode_array_loaded; |
| 426 __ cmp(FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset), |
| 427 Immediate(DebugInfo::uninitialized())); |
| 428 __ j(not_equal, &load_debug_bytecode_array); |
424 __ mov(kInterpreterBytecodeArrayRegister, | 429 __ mov(kInterpreterBytecodeArrayRegister, |
425 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); | 430 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); |
| 431 __ bind(&bytecode_array_loaded); |
426 | 432 |
427 if (FLAG_debug_code) { | 433 if (FLAG_debug_code) { |
428 // Check function data field is actually a BytecodeArray object. | 434 // Check function data field is actually a BytecodeArray object. |
429 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); | 435 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); |
430 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, | 436 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, |
431 eax); | 437 eax); |
432 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 438 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
433 } | 439 } |
434 | 440 |
435 // Push bytecode array. | 441 // Push bytecode array. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 // TODO(rmcilroy): Remove this once we move the dispatch table back into a | 502 // TODO(rmcilroy): Remove this once we move the dispatch table back into a |
497 // register. | 503 // register. |
498 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value())); | 504 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value())); |
499 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 505 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
500 // and header removal. | 506 // and header removal. |
501 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 507 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
502 __ call(ebx); | 508 __ call(ebx); |
503 | 509 |
504 // Even though the first bytecode handler was called, we will never return. | 510 // Even though the first bytecode handler was called, we will never return. |
505 __ Abort(kUnexpectedReturnFromBytecodeHandler); | 511 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
| 512 |
| 513 // Load debug copy of the bytecode array. |
| 514 __ bind(&load_debug_bytecode_array); |
| 515 Register debug_info = kInterpreterBytecodeArrayRegister; |
| 516 __ mov(debug_info, FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset)); |
| 517 __ mov(kInterpreterBytecodeArrayRegister, |
| 518 FieldOperand(debug_info, DebugInfo::kAbstractCodeIndex)); |
| 519 __ jmp(&bytecode_array_loaded); |
506 } | 520 } |
507 | 521 |
508 | 522 |
509 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 523 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
510 // TODO(rmcilroy): List of things not currently dealt with here but done in | 524 // TODO(rmcilroy): List of things not currently dealt with here but done in |
511 // fullcodegen's EmitReturnSequence. | 525 // fullcodegen's EmitReturnSequence. |
512 // - Supporting FLAG_trace for Runtime::TraceExit. | 526 // - Supporting FLAG_trace for Runtime::TraceExit. |
513 // - Support profiler (specifically decrementing profiling_counter | 527 // - Support profiler (specifically decrementing profiling_counter |
514 // appropriately and calling out to HandleInterrupts if necessary). | 528 // appropriately and calling out to HandleInterrupts if necessary). |
515 | 529 |
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 | 2663 |
2650 __ bind(&ok); | 2664 __ bind(&ok); |
2651 __ ret(0); | 2665 __ ret(0); |
2652 } | 2666 } |
2653 | 2667 |
2654 #undef __ | 2668 #undef __ |
2655 } // namespace internal | 2669 } // namespace internal |
2656 } // namespace v8 | 2670 } // namespace v8 |
2657 | 2671 |
2658 #endif // V8_TARGET_ARCH_IA32 | 2672 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |