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

Unified Diff: src/ppc/builtins-ppc.cc

Issue 1309113003: PPC: [interpreter]: Changes to interpreter builtins for accumulator and register file registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ppc/macro-assembler-ppc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index f50060443bbfd7b4569a4e91cfc6099f8fce95bc..e002df89ec6fb0dfca8f026e86410ca8336e46d2 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -8,7 +8,6 @@
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/full-codegen/full-codegen.h"
-#include "src/interpreter/bytecodes.h"
#include "src/runtime/runtime.h"
namespace v8 {
@@ -907,22 +906,22 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
Label ok;
__ sub(r6, sp, r5);
__ LoadRoot(r0, Heap::kRealStackLimitRootIndex);
- __ cmp(r6, r0);
+ __ cmpl(r6, r0);
__ bge(&ok);
__ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION);
__ bind(&ok);
// If ok, push undefined as the initial value for all register file entries.
- // Note: there should always be at least one stack slot for the return
- // register in the register file.
// TODO(rmcilroy): Consider doing more than one push per loop iteration.
- Label loop_header;
+ Label loop, no_args;
__ LoadRoot(r6, Heap::kUndefinedValueRootIndex);
- __ ShiftRightImm(r5, r5, Operand(kPointerSizeLog2));
+ __ ShiftRightImm(r5, r5, Operand(kPointerSizeLog2), SetRC);
+ __ beq(&no_args, cr0);
__ mtctr(r5);
- __ bind(&loop_header);
+ __ bind(&loop);
__ push(r6);
- __ bdnz(&loop_header);
+ __ bdnz(&loop);
+ __ bind(&no_args);
}
// TODO(rmcilroy): List of things not currently dealt with here but done in
@@ -956,7 +955,12 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ bind(&ok);
}
- // Load bytecode offset and dispatch table into registers.
+ // Load accumulator, register file, bytecode offset, dispatch table into
+ // registers.
+ __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
+ __ subi(
+ kInterpreterRegisterFileRegister, fp,
+ Operand(kPointerSize + StandardFrameConstants::kFixedFrameSizeFromFp));
__ mov(kInterpreterBytecodeOffsetRegister,
Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
__ LoadRoot(kInterpreterDispatchTableRegister,
@@ -965,14 +969,14 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
Operand(FixedArray::kHeaderSize - kHeapObjectTag));
// Dispatch to the first bytecode handler for the function.
- __ lbzx(r3, MemOperand(kInterpreterBytecodeArrayRegister,
+ __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
- __ ShiftLeftImm(ip, r3, Operand(kPointerSizeLog2));
+ __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2));
__ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip));
// TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
// and header removal.
__ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
- __ Jump(ip);
+ __ Call(ip);
}
@@ -983,10 +987,8 @@ void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
// - Support profiler (specifically decrementing profiling_counter
// appropriately and calling out to HandleInterrupts if necessary).
- // Load return value into r3.
- __ LoadP(r3,
- MemOperand(fp, -kPointerSize -
- StandardFrameConstants::kFixedFrameSizeFromFp));
+ // The return value is in accumulator, which is already in r3.
+
// Leave the frame (also dropping the register file).
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
// Drop receiver + arguments.
« no previous file with comments | « no previous file | src/ppc/macro-assembler-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698