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

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

Issue 1684073002: [Interpreter] Save and restore dispatch table pointer during calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_assm
Patch Set: Address review comments Created 4 years, 10 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 ee829d1c66aff407f01a8eb44559f02faa52bb14..cfadb702ada282e9db45fd96d33c2b970a245031 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -26,11 +26,16 @@ InterpreterAssembler::InterpreterAssembler(Isolate* isolate, Zone* zone,
isolate, zone, InterpreterDispatchDescriptor(isolate),
Code::ComputeFlags(Code::STUB), Bytecodes::ToString(bytecode), 0),
bytecode_(bytecode),
- accumulator_(
- Parameter(InterpreterDispatchDescriptor::kAccumulatorParameter)),
- context_(Parameter(InterpreterDispatchDescriptor::kContextParameter)),
+ accumulator_(this, MachineRepresentation::kTagged),
+ context_(this, MachineRepresentation::kTagged),
+ dispatch_table_(this, MachineType::PointerRepresentation()),
disable_stack_check_across_call_(false),
stack_pointer_before_call_(nullptr) {
+ accumulator_.Bind(
+ Parameter(InterpreterDispatchDescriptor::kAccumulatorParameter));
+ context_.Bind(Parameter(InterpreterDispatchDescriptor::kContextParameter));
+ dispatch_table_.Bind(
+ Parameter(InterpreterDispatchDescriptor::kDispatchTableParameter));
if (FLAG_trace_ignition) {
TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry);
}
@@ -38,15 +43,17 @@ InterpreterAssembler::InterpreterAssembler(Isolate* isolate, Zone* zone,
InterpreterAssembler::~InterpreterAssembler() {}
-Node* InterpreterAssembler::GetAccumulator() { return accumulator_; }
+Node* InterpreterAssembler::GetAccumulator() { return accumulator_.value(); }
-void InterpreterAssembler::SetAccumulator(Node* value) { accumulator_ = value; }
+void InterpreterAssembler::SetAccumulator(Node* value) {
+ accumulator_.Bind(value);
+}
-Node* InterpreterAssembler::GetContext() { return context_; }
+Node* InterpreterAssembler::GetContext() { return context_.value(); }
void InterpreterAssembler::SetContext(Node* value) {
StoreRegister(value, Register::current_context());
- context_ = value;
+ context_.Bind(value);
}
Node* InterpreterAssembler::BytecodeOffset() {
@@ -62,7 +69,7 @@ Node* InterpreterAssembler::BytecodeArrayTaggedPointer() {
}
Node* InterpreterAssembler::DispatchTableRawPointer() {
- return Parameter(InterpreterDispatchDescriptor::kDispatchTableParameter);
+ return dispatch_table_.value();
}
Node* InterpreterAssembler::RegisterLocation(Node* reg_index) {
@@ -303,6 +310,8 @@ Node* InterpreterAssembler::LoadTypeFeedbackVector() {
void InterpreterAssembler::CallPrologue() {
StoreRegister(SmiTag(BytecodeOffset()),
InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer);
+ StoreRegister(DispatchTableRawPointer(),
+ InterpreterFrameConstants::kDispatchTableFromRegisterPointer);
if (FLAG_debug_code && !disable_stack_check_across_call_) {
DCHECK(stack_pointer_before_call_ == nullptr);
@@ -318,6 +327,11 @@ void InterpreterAssembler::CallEpilogue() {
AbortIfWordNotEqual(stack_pointer_before_call, stack_pointer_after_call,
kUnexpectedStackPointer);
}
+
+ // Restore dispatch table from stack frame in case the debugger has swapped us
+ // to the debugger dispatch table.
+ dispatch_table_.Bind(LoadRegister(
+ InterpreterFrameConstants::kDispatchTableFromRegisterPointer));
}
Node* InterpreterAssembler::CallJS(Node* function, Node* context,
« 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