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

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

Issue 1321663003: [Interpreter] Add support for loading literals from the constant pool. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_const_pool_1
Patch Set: Review comments 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/bytecode-array-builder.h » ('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 d6ca45fc54f5a0e9cc7538fdc6644c9da9308fc1..25d1b5eacffe1ef208e2553eef4246e1da0df9f6 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -147,6 +147,13 @@ Node* InterpreterAssembler::BytecodeOperandImm8(int operand_index) {
}
+Node* InterpreterAssembler::BytecodeOperandIdx(int operand_index) {
+ DCHECK_EQ(interpreter::OperandType::kIdx,
+ interpreter::Bytecodes::GetOperandType(bytecode_, operand_index));
+ return BytecodeOperand(operand_index);
+}
+
+
Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) {
DCHECK_EQ(interpreter::OperandType::kReg,
interpreter::Bytecodes::GetOperandType(bytecode_, operand_index));
@@ -189,6 +196,16 @@ Node* InterpreterAssembler::SmiUntag(Node* value) {
}
+Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) {
+ Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(),
+ BytecodeArray::kConstantPoolOffset);
+ Node* entry_offset = raw_assembler_->IntPtrAdd(
+ IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag),
+ raw_assembler_->WordShl(index, Int32Constant(kPointerSizeLog2)));
+ return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset);
+}
+
+
Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) {
return raw_assembler_->Load(kMachAnyTagged, object,
IntPtrConstant(offset - kHeapObjectTag));
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698