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

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

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.cc ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.h
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
index fda32e60baf11d43efd9118059f92109711da1c2..8a45c73bbbcbb4a7bd44ca05142c8ad63da08b4d 100644
--- a/src/interpreter/bytecode-array-builder.h
+++ b/src/interpreter/bytecode-array-builder.h
@@ -9,7 +9,10 @@
#include "src/ast.h"
#include "src/frames.h"
+#include "src/identity-map.h"
#include "src/interpreter/bytecodes.h"
+#include "src/zone.h"
+#include "src/zone-containers.h"
namespace v8 {
namespace internal {
@@ -22,7 +25,7 @@ class Register;
class BytecodeArrayBuilder {
public:
- explicit BytecodeArrayBuilder(Isolate* isolate);
+ BytecodeArrayBuilder(Isolate* isolate, Zone* zone);
Handle<BytecodeArray> ToBytecodeArray();
// Set number of parameters expected by function.
@@ -37,6 +40,7 @@ class BytecodeArrayBuilder {
// Constant loads to accumulator.
BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value);
+ BytecodeArrayBuilder& LoadLiteral(Handle<Object> object);
BytecodeArrayBuilder& LoadUndefined();
BytecodeArrayBuilder& LoadNull();
BytecodeArrayBuilder& LoadTheHole();
@@ -67,13 +71,18 @@ class BytecodeArrayBuilder {
bool OperandIsValid(Bytecode bytecode, int operand_index,
uint8_t operand_value) const;
+ size_t GetConstantPoolEntry(Handle<Object> object);
+
int BorrowTemporaryRegister();
void ReturnTemporaryRegister(int reg_index);
Isolate* isolate_;
- std::vector<uint8_t> bytecodes_;
+ ZoneVector<uint8_t> bytecodes_;
bool bytecode_generated_;
+ IdentityMap<size_t> constants_map_;
+ ZoneVector<Handle<Object>> constants_;
+
int parameter_count_;
int local_register_count_;
int temporary_register_count_;
« no previous file with comments | « src/compiler/interpreter-assembler.cc ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698