Index: src/interpreter/bytecode-array-builder.h |
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h |
index 5093326bc8fb4c905535432d55f6e87171021e3c..502e9d5758e57ca76112337c4d31b6cd8c31bf93 100644 |
--- a/src/interpreter/bytecode-array-builder.h |
+++ b/src/interpreter/bytecode-array-builder.h |
@@ -5,12 +5,9 @@ |
#ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
#define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
-#include <vector> |
- |
#include "src/ast/ast.h" |
-#include "src/identity-map.h" |
#include "src/interpreter/bytecodes.h" |
-#include "src/zone.h" |
+#include "src/interpreter/constant-array-builder.h" |
#include "src/zone-containers.h" |
namespace v8 { |
@@ -21,6 +18,7 @@ class Isolate; |
namespace interpreter { |
class BytecodeLabel; |
+class ConstantArrayBuilder; |
class Register; |
// TODO(rmcilroy): Unify this with CreateArgumentsParameters::Type in Turbofan |
@@ -229,6 +227,12 @@ class BytecodeArrayBuilder final { |
ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } |
const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; } |
Isolate* isolate() const { return isolate_; } |
+ ConstantArrayBuilder* constant_array_builder() { |
+ return &constant_array_builder_; |
+ } |
+ const ConstantArrayBuilder* constant_array_builder() const { |
+ return &constant_array_builder_; |
+ } |
static Bytecode BytecodeForBinaryOperation(Token::Value op); |
static Bytecode BytecodeForCountOperation(Token::Value op); |
@@ -253,8 +257,9 @@ class BytecodeArrayBuilder final { |
static bool FitsInReg8Operand(Register value); |
static bool FitsInReg16Operand(Register value); |
- static Bytecode GetJumpWithConstantOperand(Bytecode jump_with_smi8_operand); |
- static Bytecode GetJumpWithToBoolean(Bytecode jump); |
+ static Bytecode GetJumpWithConstantOperand(Bytecode jump_smi8_operand); |
+ static Bytecode GetJumpWithConstantWideOperand(Bytecode jump_smi8_operand); |
+ static Bytecode GetJumpWithToBoolean(Bytecode jump_smi8_operand); |
Register MapRegister(Register reg); |
Register MapRegisters(Register reg, Register args_base, int args_length = 1); |
@@ -272,7 +277,11 @@ class BytecodeArrayBuilder final { |
BytecodeArrayBuilder& OutputJump(Bytecode jump_bytecode, |
BytecodeLabel* label); |
void PatchJump(const ZoneVector<uint8_t>::iterator& jump_target, |
- ZoneVector<uint8_t>::iterator jump_location); |
+ 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 LeaveBasicBlock(); |
void EnsureReturn(); |
@@ -284,6 +293,7 @@ class BytecodeArrayBuilder final { |
bool NeedToBooleanCast(); |
bool IsRegisterInAccumulator(Register reg); |
+ // Temporary register management. |
int BorrowTemporaryRegister(); |
int BorrowTemporaryRegisterNotInRange(int start_index, int end_index); |
int AllocateAndBorrowTemporaryRegister(); |
@@ -302,19 +312,16 @@ class BytecodeArrayBuilder final { |
Zone* zone_; |
ZoneVector<uint8_t> bytecodes_; |
bool bytecode_generated_; |
+ ConstantArrayBuilder constant_array_builder_; |
size_t last_block_end_; |
size_t last_bytecode_start_; |
bool exit_seen_in_block_; |
int unbound_jumps_; |
- IdentityMap<size_t> constants_map_; |
- ZoneVector<Handle<Object>> constants_; |
- |
int parameter_count_; |
int local_register_count_; |
int context_register_count_; |
int temporary_register_count_; |
- |
ZoneSet<int> free_temporaries_; |
class PreviousBytecodeHelper; |