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

Unified Diff: src/interpreter/bytecode-array-builder.h

Issue 1546683002: [Interpreter] Add support for jumps using constants with wide operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 12 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
Index: src/interpreter/bytecode-array-builder.h
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
index 4906e715ac34224bf45dec9559310728f175f02b..14e2c8a901c9f0bc8c16c195afb1c854bd44a61f 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
@@ -228,6 +226,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);
@@ -250,8 +254,9 @@ class BytecodeArrayBuilder final {
static bool FitsInIdx16Operand(int value);
static bool FitsInIdx16Operand(size_t 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);
template <size_t N>
INLINE(void Output(Bytecode bytecode, uint32_t(&oprands)[N]));
@@ -266,7 +271,7 @@ 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 LeaveBasicBlock();
void EnsureReturn();
@@ -278,6 +283,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();
@@ -296,19 +302,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;

Powered by Google App Engine
This is Rietveld 408576698