| Index: src/interpreter/bytecode-array-builder.h
|
| diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
|
| index 13a9cc2c0b75634a6328e593f346730bfd39d650..3f4af85b45ffea54e45c39cfe404963fcd120994 100644
|
| --- a/src/interpreter/bytecode-array-builder.h
|
| +++ b/src/interpreter/bytecode-array-builder.h
|
| @@ -6,6 +6,7 @@
|
| #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_
|
|
|
| #include "src/ast/ast.h"
|
| +#include "src/interpreter/bytecode-array-writer.h"
|
| #include "src/interpreter/bytecode-register-allocator.h"
|
| #include "src/interpreter/bytecodes.h"
|
| #include "src/interpreter/constant-array-builder.h"
|
| @@ -21,6 +22,7 @@ class Isolate;
|
| namespace interpreter {
|
|
|
| class BytecodeLabel;
|
| +class BytecodePipelineStage;
|
| class Register;
|
|
|
| class BytecodeArrayBuilder final : public ZoneObject {
|
| @@ -262,26 +264,16 @@ class BytecodeArrayBuilder final : public ZoneObject {
|
| void SetExpressionAsStatementPosition(Expression* expr);
|
|
|
| // Accessors
|
| - Zone* zone() const { return zone_; }
|
| TemporaryRegisterAllocator* temporary_register_allocator() {
|
| return &temporary_allocator_;
|
| }
|
| const TemporaryRegisterAllocator* temporary_register_allocator() const {
|
| return &temporary_allocator_;
|
| }
|
| + Zone* zone() const { return zone_; }
|
|
|
| void EnsureReturn();
|
|
|
| - static OperandScale OperandSizesToScale(
|
| - OperandSize size0, OperandSize size1 = OperandSize::kByte,
|
| - OperandSize size2 = OperandSize::kByte,
|
| - OperandSize size3 = OperandSize::kByte);
|
| -
|
| - static OperandSize SizeForRegisterOperand(Register reg);
|
| - static OperandSize SizeForSignedOperand(int value);
|
| - static OperandSize SizeForUnsignedOperand(int value);
|
| - static OperandSize SizeForUnsignedOperand(size_t value);
|
| -
|
| static uint32_t RegisterOperand(Register reg);
|
| static Register RegisterFromOperand(uint32_t operand);
|
| static uint32_t SignedOperand(int value, OperandSize size);
|
| @@ -289,7 +281,6 @@ class BytecodeArrayBuilder final : public ZoneObject {
|
| static uint32_t UnsignedOperand(size_t value);
|
|
|
| private:
|
| - class PreviousBytecodeHelper;
|
| friend class BytecodeRegisterAllocator;
|
|
|
| static Bytecode BytecodeForBinaryOperation(Token::Value op);
|
| @@ -307,9 +298,6 @@ class BytecodeArrayBuilder final : public ZoneObject {
|
| static Bytecode GetJumpWithConstantOperand(Bytecode jump_smi8_operand);
|
| static Bytecode GetJumpWithToBoolean(Bytecode jump_smi8_operand);
|
|
|
| - template <size_t N>
|
| - INLINE(void Output(Bytecode bytecode, uint32_t (&operands)[N],
|
| - OperandScale operand_scale = OperandScale::kSingle));
|
| void Output(Bytecode bytecode);
|
| void OutputScaled(Bytecode bytecode, OperandScale operand_scale,
|
| uint32_t operand0, uint32_t operand1, uint32_t operand2,
|
| @@ -323,14 +311,14 @@ class BytecodeArrayBuilder final : public ZoneObject {
|
|
|
| BytecodeArrayBuilder& OutputJump(Bytecode jump_bytecode,
|
| BytecodeLabel* label);
|
| - void PatchJump(const ZoneVector<uint8_t>::iterator& jump_target,
|
| - const ZoneVector<uint8_t>::iterator& jump_location);
|
| - void PatchIndirectJumpWith8BitOperand(
|
| - const ZoneVector<uint8_t>::iterator& jump_location, int delta);
|
| - void PatchIndirectJumpWith16BitOperand(
|
| - const ZoneVector<uint8_t>::iterator& jump_location, int delta);
|
| - void PatchIndirectJumpWith32BitOperand(
|
| - const ZoneVector<uint8_t>::iterator& jump_location, int delta);
|
| + void PatchJump(ZoneVector<uint8_t>* bytecodes, size_t jump_target,
|
| + size_t jump_location);
|
| + void PatchJumpWith8BitOperand(ZoneVector<uint8_t>* bytecodes,
|
| + size_t jump_location, int delta);
|
| + void PatchJumpWith16BitOperand(ZoneVector<uint8_t>* bytecodes,
|
| + size_t jump_location, int delta);
|
| + void PatchJumpWith32BitOperand(ZoneVector<uint8_t>* bytecodes,
|
| + size_t jump_location, int delta);
|
|
|
| void LeaveBasicBlock();
|
|
|
| @@ -338,19 +326,18 @@ class BytecodeArrayBuilder final : public ZoneObject {
|
| int operand_index, uint32_t operand_value) const;
|
| bool RegisterIsValid(Register reg, OperandSize reg_size) const;
|
|
|
| - bool LastBytecodeInSameBlock() const;
|
| - bool NeedToBooleanCast();
|
| - bool IsRegisterInAccumulator(Register reg);
|
| -
|
| // Set position for return.
|
| void SetReturnPosition();
|
|
|
| // Gets a constant pool entry for the |object|.
|
| size_t GetConstantPoolEntry(Handle<Object> object);
|
|
|
| - ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; }
|
| - const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; }
|
| Isolate* isolate() const { return isolate_; }
|
| + BytecodeArrayWriter* bytecode_array_writer() {
|
| + return &bytecode_array_writer_;
|
| + }
|
| + BytecodePipelineStage* pipeline() { return pipeline_; }
|
| + BytecodeNode* current_node() { return current_node_; }
|
| ConstantArrayBuilder* constant_array_builder() {
|
| return &constant_array_builder_;
|
| }
|
| @@ -363,16 +350,16 @@ class BytecodeArrayBuilder final : public ZoneObject {
|
| SourcePositionTableBuilder* source_position_table_builder() {
|
| return &source_position_table_builder_;
|
| }
|
| + BytecodeNodeAllocator* bytecode_node_allocator() {
|
| + return &bytecode_node_allocator_;
|
| + }
|
|
|
| Isolate* isolate_;
|
| Zone* zone_;
|
| - ZoneVector<uint8_t> bytecodes_;
|
| bool bytecode_generated_;
|
| ConstantArrayBuilder constant_array_builder_;
|
| HandlerTableBuilder handler_table_builder_;
|
| SourcePositionTableBuilder source_position_table_builder_;
|
| - size_t last_block_end_;
|
| - size_t last_bytecode_start_;
|
| bool exit_seen_in_block_;
|
| int unbound_jumps_;
|
| int parameter_count_;
|
| @@ -380,6 +367,10 @@ class BytecodeArrayBuilder final : public ZoneObject {
|
| int context_register_count_;
|
| int return_position_;
|
| TemporaryRegisterAllocator temporary_allocator_;
|
| + BytecodeNodeAllocator bytecode_node_allocator_;
|
| + BytecodeArrayWriter bytecode_array_writer_;
|
| + BytecodePipelineStage* pipeline_;
|
| + BytecodeNode* current_node_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder);
|
| };
|
|
|