Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: src/ppc/builtins-ppc.cc

Issue 1531873002: PPC: [Interpreter] Save bytecode offset in interpreter stack frames. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 // frame. 756 // frame.
757 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 757 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
758 // Open a frame scope to indicate that there is a frame on the stack. The 758 // Open a frame scope to indicate that there is a frame on the stack. The
759 // MANUAL indicates that the scope shouldn't actually generate code to set up 759 // MANUAL indicates that the scope shouldn't actually generate code to set up
760 // the frame (that is done below). 760 // the frame (that is done below).
761 FrameScope frame_scope(masm, StackFrame::MANUAL); 761 FrameScope frame_scope(masm, StackFrame::MANUAL);
762 __ PushFixedFrame(r4); 762 __ PushFixedFrame(r4);
763 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 763 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
764 __ push(r6); 764 __ push(r6);
765 765
766 // Push zero for bytecode array offset.
767 __ li(r3, Operand::Zero());
768 __ push(r3);
769
766 // Get the bytecode array from the function object and load the pointer to the 770 // Get the bytecode array from the function object and load the pointer to the
767 // first entry into kInterpreterBytecodeRegister. 771 // first entry into kInterpreterBytecodeRegister.
768 __ LoadP(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); 772 __ LoadP(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
769 __ LoadP(kInterpreterBytecodeArrayRegister, 773 __ LoadP(kInterpreterBytecodeArrayRegister,
770 FieldMemOperand(r3, SharedFunctionInfo::kFunctionDataOffset)); 774 FieldMemOperand(r3, SharedFunctionInfo::kFunctionDataOffset));
771 775
772 if (FLAG_debug_code) { 776 if (FLAG_debug_code) {
773 // Check function data field is actually a BytecodeArray object. 777 // Check function data field is actually a BytecodeArray object.
774 __ TestIfSmi(kInterpreterBytecodeArrayRegister, r0); 778 __ TestIfSmi(kInterpreterBytecodeArrayRegister, r0);
775 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); 779 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 __ bge(&ok); 825 __ bge(&ok);
822 __ push(kInterpreterBytecodeArrayRegister); 826 __ push(kInterpreterBytecodeArrayRegister);
823 __ CallRuntime(Runtime::kStackGuard, 0); 827 __ CallRuntime(Runtime::kStackGuard, 0);
824 __ pop(kInterpreterBytecodeArrayRegister); 828 __ pop(kInterpreterBytecodeArrayRegister);
825 __ bind(&ok); 829 __ bind(&ok);
826 } 830 }
827 831
828 // Load accumulator, register file, bytecode offset, dispatch table into 832 // Load accumulator, register file, bytecode offset, dispatch table into
829 // registers. 833 // registers.
830 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 834 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
831 __ subi(kInterpreterRegisterFileRegister, fp, 835 __ addi(kInterpreterRegisterFileRegister, fp,
832 Operand(2 * kPointerSize + 836 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
833 StandardFrameConstants::kFixedFrameSizeFromFp));
834 __ mov(kInterpreterBytecodeOffsetRegister, 837 __ mov(kInterpreterBytecodeOffsetRegister,
835 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); 838 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
836 __ LoadRoot(kInterpreterDispatchTableRegister, 839 __ LoadRoot(kInterpreterDispatchTableRegister,
837 Heap::kInterpreterTableRootIndex); 840 Heap::kInterpreterTableRootIndex);
838 __ addi(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, 841 __ addi(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister,
839 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 842 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
840 843
841 // Dispatch to the first bytecode handler for the function. 844 // Dispatch to the first bytecode handler for the function.
842 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, 845 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister,
843 kInterpreterBytecodeOffsetRegister)); 846 kInterpreterBytecodeOffsetRegister));
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 __ bkpt(0); 1981 __ bkpt(0);
1979 } 1982 }
1980 } 1983 }
1981 1984
1982 1985
1983 #undef __ 1986 #undef __
1984 } // namespace internal 1987 } // namespace internal
1985 } // namespace v8 1988 } // namespace v8
1986 1989
1987 #endif // V8_TARGET_ARCH_PPC 1990 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698