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

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

Issue 2092763002: [Interpreter] Maintain a pointer to the current position in the bytecode Base URL: https://chromium.googlesource.com/v8/v8.git@int_cache_fp_and_bytecode
Patch Set: Rebase Created 4 years, 6 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
Index: src/interpreter/interpreter-assembler.cc
diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc
index ee5f8be27981f19b63ddf8eb3029729cb147a7fa..637c3ca6a039c1cc8c243a6dc445b95db2896afe 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -32,6 +32,7 @@ InterpreterAssembler::InterpreterAssembler(Isolate* isolate, Zone* zone,
bytecode_(bytecode),
operand_scale_(operand_scale),
interpreted_frame_pointer_(this, MachineType::PointerRepresentation()),
+ bytecode_inner_pointer_(this, MachineType::PointerRepresentation()),
accumulator_(this, MachineRepresentation::kTagged),
accumulator_use_(AccumulatorUse::kNone),
made_call_(false),
@@ -96,6 +97,14 @@ Node* InterpreterAssembler::BytecodeArrayTaggedPointer() {
}
}
+Node* InterpreterAssembler::BytecodeInnerPointer() {
+ if (!bytecode_inner_pointer_.IsBound() || made_call_) {
+ bytecode_inner_pointer_.Bind(
+ IntPtrAdd(BytecodeArrayTaggedPointer(), BytecodeOffset()));
+ }
+ return bytecode_inner_pointer_.value();
+}
+
Node* InterpreterAssembler::DispatchTableRawPointer() {
return Parameter(InterpreterDispatchDescriptor::kDispatchTableParameter);
}
@@ -146,8 +155,7 @@ Node* InterpreterAssembler::BytecodeOperandUnsignedByte(int operand_index) {
DCHECK_EQ(OperandSize::kByte, Bytecodes::GetOperandSize(
bytecode_, operand_index, operand_scale()));
Node* operand_offset = OperandOffset(operand_index);
- return Load(MachineType::Uint8(), BytecodeArrayTaggedPointer(),
- IntPtrAdd(BytecodeOffset(), operand_offset));
+ return Load(MachineType::Uint8(), BytecodeInnerPointer(), operand_offset);
}
Node* InterpreterAssembler::BytecodeOperandSignedByte(int operand_index) {
@@ -155,8 +163,8 @@ Node* InterpreterAssembler::BytecodeOperandSignedByte(int operand_index) {
DCHECK_EQ(OperandSize::kByte, Bytecodes::GetOperandSize(
bytecode_, operand_index, operand_scale()));
Node* operand_offset = OperandOffset(operand_index);
- Node* load = Load(MachineType::Int8(), BytecodeArrayTaggedPointer(),
- IntPtrAdd(BytecodeOffset(), operand_offset));
+ Node* load =
+ Load(MachineType::Int8(), BytecodeInnerPointer(), operand_offset);
// Ensure that we sign extend to full pointer size
if (kPointerSize == 8) {
@@ -224,8 +232,8 @@ Node* InterpreterAssembler::BytecodeOperandUnsignedShort(int operand_index) {
int operand_offset =
Bytecodes::GetOperandOffset(bytecode_, operand_index, operand_scale());
if (TargetSupportsUnalignedAccess()) {
- return Load(MachineType::Uint16(), BytecodeArrayTaggedPointer(),
- IntPtrAdd(BytecodeOffset(), IntPtrConstant(operand_offset)));
+ return Load(MachineType::Uint16(), BytecodeInnerPointer(),
+ IntPtrConstant(operand_offset));
} else {
return BytecodeOperandReadUnaligned(operand_offset, MachineType::Uint16());
}
@@ -240,8 +248,8 @@ Node* InterpreterAssembler::BytecodeOperandSignedShort(int operand_index) {
Bytecodes::GetOperandOffset(bytecode_, operand_index, operand_scale());
Node* load;
if (TargetSupportsUnalignedAccess()) {
- load = Load(MachineType::Int16(), BytecodeArrayTaggedPointer(),
- IntPtrAdd(BytecodeOffset(), IntPtrConstant(operand_offset)));
+ load = Load(MachineType::Int16(), BytecodeInnerPointer(),
+ IntPtrConstant(operand_offset));
} else {
load = BytecodeOperandReadUnaligned(operand_offset, MachineType::Int16());
}
@@ -260,8 +268,8 @@ Node* InterpreterAssembler::BytecodeOperandUnsignedQuad(int operand_index) {
int operand_offset =
Bytecodes::GetOperandOffset(bytecode_, operand_index, operand_scale());
if (TargetSupportsUnalignedAccess()) {
- return Load(MachineType::Uint32(), BytecodeArrayTaggedPointer(),
- IntPtrAdd(BytecodeOffset(), IntPtrConstant(operand_offset)));
+ return Load(MachineType::Uint32(), BytecodeInnerPointer(),
+ IntPtrConstant(operand_offset));
} else {
return BytecodeOperandReadUnaligned(operand_offset, MachineType::Uint32());
}
@@ -275,8 +283,8 @@ Node* InterpreterAssembler::BytecodeOperandSignedQuad(int operand_index) {
Bytecodes::GetOperandOffset(bytecode_, operand_index, operand_scale());
Node* load;
if (TargetSupportsUnalignedAccess()) {
- load = Load(MachineType::Int32(), BytecodeArrayTaggedPointer(),
- IntPtrAdd(BytecodeOffset(), IntPtrConstant(operand_offset)));
+ load = Load(MachineType::Int32(), BytecodeInnerPointer(),
+ IntPtrConstant(operand_offset));
} else {
load = BytecodeOperandReadUnaligned(operand_offset, MachineType::Int32());
}
« no previous file with comments | « src/interpreter/interpreter-assembler.h ('k') | test/unittests/interpreter/interpreter-assembler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698