Chromium Code Reviews| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 891 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) { | 891 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) { |
| 892 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); | 892 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); |
| 893 } | 893 } |
| 894 | 894 |
| 895 | 895 |
| 896 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { | 896 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { |
| 897 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 897 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
| 898 } | 898 } |
| 899 | 899 |
| 900 | 900 |
| 901 void Builtins::Generate_InterpreterEnterExceptionHandler(MacroAssembler* masm) { | |
|
Michael Starzinger
2016/01/19 18:21:51
Note that this is an unmodified copy of the code f
oth
2016/01/20 07:49:08
For now I'd settle for a comment at the start of t
rmcilroy
2016/01/20 08:52:13
If it's unmodified let's just factor this out in t
Michael Starzinger
2016/01/20 11:45:27
Done. Since it's unmodified, I went with a minimal
| |
| 902 // Initialize register file register and dispatch table register. | |
| 903 __ movp(kInterpreterRegisterFileRegister, rbp); | |
| 904 __ addp(kInterpreterRegisterFileRegister, | |
| 905 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | |
| 906 __ LoadRoot(kInterpreterDispatchTableRegister, | |
| 907 Heap::kInterpreterTableRootIndex); | |
| 908 __ addp(kInterpreterDispatchTableRegister, | |
| 909 Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); | |
| 910 | |
| 911 // Get the context from the frame. | |
| 912 // TODO(rmcilroy): Update interpreter frame to expect current context at the | |
| 913 // context slot instead of the function context. | |
| 914 __ movp(kContextRegister, | |
| 915 Operand(kInterpreterRegisterFileRegister, | |
| 916 InterpreterFrameConstants::kContextFromRegisterPointer)); | |
| 917 | |
| 918 // Get the bytecode array pointer from the frame. | |
| 919 __ movp(rbx, | |
| 920 Operand(kInterpreterRegisterFileRegister, | |
| 921 InterpreterFrameConstants::kFunctionFromRegisterPointer)); | |
| 922 __ movp(rbx, FieldOperand(rbx, JSFunction::kSharedFunctionInfoOffset)); | |
| 923 __ movp(kInterpreterBytecodeArrayRegister, | |
| 924 FieldOperand(rbx, SharedFunctionInfo::kFunctionDataOffset)); | |
| 925 | |
| 926 if (FLAG_debug_code) { | |
| 927 // Check function data field is actually a BytecodeArray object. | |
| 928 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); | |
| 929 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, | |
| 930 rbx); | |
| 931 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | |
| 932 } | |
| 933 | |
| 934 // Get the target bytecode offset from the frame. | |
| 935 __ movp( | |
| 936 kInterpreterBytecodeOffsetRegister, | |
| 937 Operand(kInterpreterRegisterFileRegister, | |
| 938 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); | |
| 939 __ SmiToInteger32(kInterpreterBytecodeOffsetRegister, | |
| 940 kInterpreterBytecodeOffsetRegister); | |
| 941 | |
| 942 // Dispatch to the target bytecode. | |
| 943 __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister, | |
| 944 kInterpreterBytecodeOffsetRegister, times_1, 0)); | |
| 945 __ movp(rbx, Operand(kInterpreterDispatchTableRegister, rbx, | |
| 946 times_pointer_size, 0)); | |
| 947 __ addp(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | |
| 948 __ jmp(rbx); | |
| 949 } | |
| 950 | |
| 951 | |
| 901 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 952 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
| 902 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 953 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
| 903 GenerateTailCallToReturnedCode(masm); | 954 GenerateTailCallToReturnedCode(masm); |
| 904 } | 955 } |
| 905 | 956 |
| 906 | 957 |
| 907 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { | 958 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { |
| 908 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); | 959 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); |
| 909 GenerateTailCallToReturnedCode(masm); | 960 GenerateTailCallToReturnedCode(masm); |
| 910 } | 961 } |
| (...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2604 __ ret(0); | 2655 __ ret(0); |
| 2605 } | 2656 } |
| 2606 | 2657 |
| 2607 | 2658 |
| 2608 #undef __ | 2659 #undef __ |
| 2609 | 2660 |
| 2610 } // namespace internal | 2661 } // namespace internal |
| 2611 } // namespace v8 | 2662 } // namespace v8 |
| 2612 | 2663 |
| 2613 #endif // V8_TARGET_ARCH_X64 | 2664 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |