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

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

Issue 1370893002: [Interpreter] Add support for short (16 bit) operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win bots. Created 5 years, 3 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/compiler/interpreter-assembler.cc
diff --git a/src/compiler/interpreter-assembler.cc b/src/compiler/interpreter-assembler.cc
index 1f5c0a26a5c8f16560cb124e384563c800972c92..c73b628bb193e326544e8d4fad5c3b5ce8db968d 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -126,17 +126,27 @@ Node* InterpreterAssembler::StoreRegister(Node* value, Node* reg_index) {
Node* InterpreterAssembler::BytecodeOperand(int operand_index) {
DCHECK_LT(operand_index, interpreter::Bytecodes::NumberOfOperands(bytecode_));
+ DCHECK(interpreter::OperandSize::kByte ==
+ interpreter::Bytecodes::SizeOfOperand(
+ interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)));
return raw_assembler_->Load(
kMachUint8, BytecodeArrayTaggedPointer(),
- IntPtrAdd(BytecodeOffset(), Int32Constant(1 + operand_index)));
+ IntPtrAdd(BytecodeOffset(),
+ Int32Constant(interpreter::Bytecodes::GetOperandOffset(
+ bytecode_, operand_index))));
}
Node* InterpreterAssembler::BytecodeOperandSignExtended(int operand_index) {
DCHECK_LT(operand_index, interpreter::Bytecodes::NumberOfOperands(bytecode_));
+ DCHECK(interpreter::OperandSize::kByte ==
+ interpreter::Bytecodes::SizeOfOperand(
+ interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)));
Node* load = raw_assembler_->Load(
kMachInt8, BytecodeArrayTaggedPointer(),
- IntPtrAdd(BytecodeOffset(), Int32Constant(1 + operand_index)));
+ IntPtrAdd(BytecodeOffset(),
+ Int32Constant(interpreter::Bytecodes::GetOperandOffset(
+ bytecode_, operand_index))));
// Ensure that we sign extend to full pointer size
if (kPointerSize == 8) {
load = raw_assembler_->ChangeInt32ToInt64(load);
@@ -145,6 +155,19 @@ Node* InterpreterAssembler::BytecodeOperandSignExtended(int operand_index) {
}
+Node* InterpreterAssembler::BytecodeOperandWide(int operand_index) {
+ DCHECK_LT(operand_index, interpreter::Bytecodes::NumberOfOperands(bytecode_));
+ DCHECK(interpreter::OperandSize::kWide ==
+ interpreter::Bytecodes::SizeOfOperand(
+ interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)));
+ return raw_assembler_->Load(
+ kMachUint16, BytecodeArrayTaggedPointer(),
+ IntPtrAdd(BytecodeOffset(),
+ Int32Constant(interpreter::Bytecodes::GetOperandOffset(
+ bytecode_, operand_index))));
+}
+
+
Node* InterpreterAssembler::BytecodeOperandCount(int operand_index) {
DCHECK_EQ(interpreter::OperandType::kCount,
interpreter::Bytecodes::GetOperandType(bytecode_, operand_index));
@@ -173,6 +196,13 @@ Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) {
}
+Node* InterpreterAssembler::BytecodeOperandWideIdx(int operand_index) {
+ DCHECK_EQ(interpreter::OperandType::kWideIdx,
+ interpreter::Bytecodes::GetOperandType(bytecode_, operand_index));
+ return BytecodeOperandWide(operand_index);
+}
+
+
Node* InterpreterAssembler::Int32Constant(int value) {
return raw_assembler_->Int32Constant(value);
}

Powered by Google App Engine
This is Rietveld 408576698