aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/interpreter/interpreter-assembler.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/interpreter/interpreter-assembler.h')
-rw-r--r--deps/v8/src/interpreter/interpreter-assembler.h51
1 files changed, 43 insertions, 8 deletions
diff --git a/deps/v8/src/interpreter/interpreter-assembler.h b/deps/v8/src/interpreter/interpreter-assembler.h
index 9600dfb6c5..86ecea54dd 100644
--- a/deps/v8/src/interpreter/interpreter-assembler.h
+++ b/deps/v8/src/interpreter/interpreter-assembler.h
@@ -19,12 +19,16 @@ namespace interpreter {
class InterpreterAssembler : public compiler::CodeStubAssembler {
public:
- InterpreterAssembler(Isolate* isolate, Zone* zone, Bytecode bytecode);
+ InterpreterAssembler(Isolate* isolate, Zone* zone, Bytecode bytecode,
+ OperandScale operand_scale);
virtual ~InterpreterAssembler();
// Returns the count immediate for bytecode operand |operand_index| in the
// current bytecode.
compiler::Node* BytecodeOperandCount(int operand_index);
+ // Returns the 8-bit flag for bytecode operand |operand_index| in the
+ // current bytecode.
+ compiler::Node* BytecodeOperandFlag(int operand_index);
// Returns the index immediate for bytecode operand |operand_index| in the
// current bytecode.
compiler::Node* BytecodeOperandIdx(int operand_index);
@@ -34,6 +38,9 @@ class InterpreterAssembler : public compiler::CodeStubAssembler {
// Returns the register index for bytecode operand |operand_index| in the
// current bytecode.
compiler::Node* BytecodeOperandReg(int operand_index);
+ // Returns the runtime id immediate for bytecode operand
+ // |operand_index| in the current bytecode.
+ compiler::Node* BytecodeOperandRuntimeId(int operand_index);
// Accumulator.
compiler::Node* GetAccumulator();
@@ -62,9 +69,6 @@ class InterpreterAssembler : public compiler::CodeStubAssembler {
// Load constant at |index| in the constant pool.
compiler::Node* LoadConstantPoolEntry(compiler::Node* index);
- // Load an element from a fixed array on the heap.
- compiler::Node* LoadFixedArrayElement(compiler::Node* fixed_array, int index);
-
// Load a field from an object on the heap.
compiler::Node* LoadObjectField(compiler::Node* object, int offset);
@@ -139,10 +143,14 @@ class InterpreterAssembler : public compiler::CodeStubAssembler {
DispatchToBytecodeHandler(handler, BytecodeOffset());
}
+ // Dispatch bytecode as wide operand variant.
+ void DispatchWide(OperandScale operand_scale);
+
// Abort with the given bailout reason.
void Abort(BailoutReason bailout_reason);
protected:
+ Bytecode bytecode() const { return bytecode_; }
static bool TargetSupportsUnalignedAccess();
private:
@@ -155,6 +163,11 @@ class InterpreterAssembler : public compiler::CodeStubAssembler {
// Returns a raw pointer to first entry in the interpreter dispatch table.
compiler::Node* DispatchTableRawPointer();
+ // Returns the accumulator value without checking whether bytecode
+ // uses it. This is intended to be used only in dispatch and in
+ // tracing as these need to bypass accumulator use validity checks.
+ compiler::Node* GetAccumulatorUnchecked();
+
// Saves and restores interpreter bytecode offset to the interpreter stack
// frame when performing a call.
void CallPrologue() override;
@@ -170,10 +183,28 @@ class InterpreterAssembler : public compiler::CodeStubAssembler {
// Returns the offset of register |index| relative to RegisterFilePointer().
compiler::Node* RegisterFrameOffset(compiler::Node* index);
- compiler::Node* BytecodeOperand(int operand_index);
- compiler::Node* BytecodeOperandSignExtended(int operand_index);
- compiler::Node* BytecodeOperandShort(int operand_index);
- compiler::Node* BytecodeOperandShortSignExtended(int operand_index);
+ // Returns the offset of an operand relative to the current bytecode offset.
+ compiler::Node* OperandOffset(int operand_index);
+
+ // Returns a value built from an sequence of bytes in the bytecode
+ // array starting at |relative_offset| from the current bytecode.
+ // The |result_type| determines the size and signedness. of the
+ // value read. This method should only be used on architectures that
+ // do not support unaligned memory accesses.
+ compiler::Node* BytecodeOperandReadUnaligned(int relative_offset,
+ MachineType result_type);
+
+ compiler::Node* BytecodeOperandUnsignedByte(int operand_index);
+ compiler::Node* BytecodeOperandSignedByte(int operand_index);
+ compiler::Node* BytecodeOperandUnsignedShort(int operand_index);
+ compiler::Node* BytecodeOperandSignedShort(int operand_index);
+ compiler::Node* BytecodeOperandUnsignedQuad(int operand_index);
+ compiler::Node* BytecodeOperandSignedQuad(int operand_index);
+
+ compiler::Node* BytecodeSignedOperand(int operand_index,
+ OperandSize operand_size);
+ compiler::Node* BytecodeUnsignedOperand(int operand_index,
+ OperandSize operand_size);
// Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not
// update BytecodeOffset() itself.
@@ -187,8 +218,12 @@ class InterpreterAssembler : public compiler::CodeStubAssembler {
void AbortIfWordNotEqual(compiler::Node* lhs, compiler::Node* rhs,
BailoutReason bailout_reason);
+ OperandScale operand_scale() const { return operand_scale_; }
+
Bytecode bytecode_;
+ OperandScale operand_scale_;
CodeStubAssembler::Variable accumulator_;
+ AccumulatorUse accumulator_use_;
CodeStubAssembler::Variable context_;
CodeStubAssembler::Variable bytecode_array_;