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

Unified Diff: src/interpreter/interpreter-assembler.cc

Issue 1894063002: [Interpreter] Remove register file register and replace with LoadParentFramePointer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix gcc Created 4 years, 8 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 | « src/interpreter/interpreter-assembler.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter-assembler.cc
diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc
index 9f2b5b629367f61e30f6769cc65bccb0673bc04e..66af04f5f0509c80888e9d1bcc97e609170ad0db 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -77,16 +77,11 @@ Node* InterpreterAssembler::BytecodeOffset() {
return Parameter(InterpreterDispatchDescriptor::kBytecodeOffsetParameter);
}
-Node* InterpreterAssembler::RegisterFileRawPointer() {
- return Parameter(InterpreterDispatchDescriptor::kRegisterFileParameter);
-}
-
Node* InterpreterAssembler::BytecodeArrayTaggedPointer() {
if (made_call_) {
// If we have made a call, restore bytecode array from stack frame in case
// the debugger has swapped us to the patched debugger bytecode array.
- return LoadRegister(
- InterpreterFrameConstants::kBytecodeArrayFromRegisterPointer);
+ return LoadRegister(Register::bytecode_array());
} else {
return Parameter(InterpreterDispatchDescriptor::kBytecodeArrayParameter);
}
@@ -97,40 +92,32 @@ Node* InterpreterAssembler::DispatchTableRawPointer() {
}
Node* InterpreterAssembler::RegisterLocation(Node* reg_index) {
- return IntPtrAdd(RegisterFileRawPointer(), RegisterFrameOffset(reg_index));
+ return IntPtrAdd(LoadParentFramePointer(), RegisterFrameOffset(reg_index));
}
-Node* InterpreterAssembler::LoadRegister(int offset) {
- return Load(MachineType::AnyTagged(), RegisterFileRawPointer(),
- IntPtrConstant(offset));
+Node* InterpreterAssembler::RegisterFrameOffset(Node* index) {
+ return WordShl(index, kPointerSizeLog2);
}
Node* InterpreterAssembler::LoadRegister(Register reg) {
- return LoadRegister(-reg.index() << kPointerSizeLog2);
-}
-
-Node* InterpreterAssembler::RegisterFrameOffset(Node* index) {
- return WordShl(index, kPointerSizeLog2);
+ return Load(MachineType::AnyTagged(), LoadParentFramePointer(),
+ IntPtrConstant(reg.ToOperand() << kPointerSizeLog2));
}
Node* InterpreterAssembler::LoadRegister(Node* reg_index) {
- return Load(MachineType::AnyTagged(), RegisterFileRawPointer(),
+ return Load(MachineType::AnyTagged(), LoadParentFramePointer(),
RegisterFrameOffset(reg_index));
}
-Node* InterpreterAssembler::StoreRegister(Node* value, int offset) {
- return StoreNoWriteBarrier(MachineRepresentation::kTagged,
- RegisterFileRawPointer(), IntPtrConstant(offset),
- value);
-}
-
Node* InterpreterAssembler::StoreRegister(Node* value, Register reg) {
- return StoreRegister(value, IntPtrConstant(-reg.index()));
+ return StoreNoWriteBarrier(
+ MachineRepresentation::kTagged, LoadParentFramePointer(),
+ IntPtrConstant(reg.ToOperand() << kPointerSizeLog2), value);
}
Node* InterpreterAssembler::StoreRegister(Node* value, Node* reg_index) {
return StoreNoWriteBarrier(MachineRepresentation::kTagged,
- RegisterFileRawPointer(),
+ LoadParentFramePointer(),
RegisterFrameOffset(reg_index), value);
}
@@ -410,9 +397,7 @@ Node* InterpreterAssembler::StoreContextSlot(Node* context, Node* slot_index,
}
Node* InterpreterAssembler::LoadTypeFeedbackVector() {
- Node* function = Load(
- MachineType::AnyTagged(), RegisterFileRawPointer(),
- IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer));
+ Node* function = LoadRegister(Register::function_closure());
Node* shared_info =
LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset);
Node* vector =
@@ -421,8 +406,7 @@ Node* InterpreterAssembler::LoadTypeFeedbackVector() {
}
void InterpreterAssembler::CallPrologue() {
- StoreRegister(SmiTag(BytecodeOffset()),
- InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer);
+ StoreRegister(SmiTag(BytecodeOffset()), Register::bytecode_offset());
if (FLAG_debug_code && !disable_stack_check_across_call_) {
DCHECK(stack_pointer_before_call_ == nullptr);
@@ -579,9 +563,8 @@ void InterpreterAssembler::DispatchToBytecodeHandlerEntry(
}
InterpreterDispatchDescriptor descriptor(isolate());
- Node* args[] = {GetAccumulatorUnchecked(), RegisterFileRawPointer(),
- bytecode_offset, BytecodeArrayTaggedPointer(),
- DispatchTableRawPointer()};
+ Node* args[] = {GetAccumulatorUnchecked(), bytecode_offset,
+ BytecodeArrayTaggedPointer(), DispatchTableRawPointer()};
TailCallBytecodeDispatch(descriptor, handler_entry, args);
}
« no previous file with comments | « src/interpreter/interpreter-assembler.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698