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

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

Issue 1294793002: [Interpreter] Add implementations for load immediate bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@interpreter_accum
Patch Set: Rebased 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 | « src/compiler/interpreter-assembler.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/interpreter-assembler.cc
diff --git a/src/compiler/interpreter-assembler.cc b/src/compiler/interpreter-assembler.cc
index 135a54815a4ff4057bc2d2446a16a2fc574fddf9..47e014ba3992b3aa2e1b1ce4b191b0f76b15930c 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -110,19 +110,21 @@ Node* InterpreterAssembler::StoreRegister(Node* value, Node* reg_index) {
}
-Node* InterpreterAssembler::BytecodeOperand(int delta) {
- DCHECK_LT(delta, interpreter::Bytecodes::NumberOfOperands(bytecode_));
+Node* InterpreterAssembler::BytecodeOperand(int operand_index) {
+ DCHECK_LT(operand_index, interpreter::Bytecodes::NumberOfOperands(bytecode_));
return raw_assembler_->Load(
kMachUint8, BytecodeArrayTaggedPointer(),
- raw_assembler_->IntPtrAdd(BytecodeOffset(), Int32Constant(1 + delta)));
+ raw_assembler_->IntPtrAdd(BytecodeOffset(),
+ Int32Constant(1 + operand_index)));
}
-Node* InterpreterAssembler::BytecodeOperandSignExtended(int delta) {
- DCHECK_LT(delta, interpreter::Bytecodes::NumberOfOperands(bytecode_));
+Node* InterpreterAssembler::BytecodeOperandSignExtended(int operand_index) {
+ DCHECK_LT(operand_index, interpreter::Bytecodes::NumberOfOperands(bytecode_));
Node* load = raw_assembler_->Load(
kMachInt8, BytecodeArrayTaggedPointer(),
- raw_assembler_->IntPtrAdd(BytecodeOffset(), Int32Constant(1 + delta)));
+ raw_assembler_->IntPtrAdd(BytecodeOffset(),
+ Int32Constant(1 + operand_index)));
// Ensure that we sign extend to full pointer size
if (kPointerSize == 8) {
load = raw_assembler_->ChangeInt32ToInt64(load);
@@ -131,6 +133,50 @@ Node* InterpreterAssembler::BytecodeOperandSignExtended(int delta) {
}
+Node* InterpreterAssembler::BytecodeOperandImm8(int operand_index) {
+ DCHECK_EQ(interpreter::OperandType::kImm8,
+ interpreter::Bytecodes::GetOperandType(bytecode_, operand_index));
+ return BytecodeOperandSignExtended(operand_index);
+}
+
+
+Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) {
+ DCHECK_EQ(interpreter::OperandType::kReg,
+ interpreter::Bytecodes::GetOperandType(bytecode_, operand_index));
+ return BytecodeOperandSignExtended(operand_index);
+}
+
+
+Node* InterpreterAssembler::Int32Constant(int value) {
+ return raw_assembler_->Int32Constant(value);
+}
+
+
+Node* InterpreterAssembler::NumberConstant(double value) {
+ return raw_assembler_->NumberConstant(value);
+}
+
+
+Node* InterpreterAssembler::HeapConstant(Unique<HeapObject> object) {
+ return raw_assembler_->HeapConstant(object);
+}
+
+
+Node* InterpreterAssembler::SmiShiftBitsConstant() {
+ return Int32Constant(kSmiShiftSize + kSmiTagSize);
+}
+
+
+Node* InterpreterAssembler::SmiTag(Node* value) {
+ return raw_assembler_->WordShl(value, SmiShiftBitsConstant());
+}
+
+
+Node* InterpreterAssembler::SmiUntag(Node* value) {
+ return raw_assembler_->WordSar(value, SmiShiftBitsConstant());
+}
+
+
void InterpreterAssembler::Return() {
Node* exit_trampoline_code_object =
HeapConstant(Unique<HeapObject>::CreateImmovable(
@@ -213,19 +259,6 @@ Schedule* InterpreterAssembler::schedule() {
}
-Node* InterpreterAssembler::Int32Constant(int value) {
- return raw_assembler_->Int32Constant(value);
-}
-
-
-Node* InterpreterAssembler::NumberConstant(double value) {
- return raw_assembler_->NumberConstant(value);
-}
-
-
-Node* InterpreterAssembler::HeapConstant(Unique<HeapObject> object) {
- return raw_assembler_->HeapConstant(object);
-}
} // namespace interpreter
} // namespace internal
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698