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

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: 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
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..80f4c7a18ef49300c4e206df6fd16bd694f49ae8 100644
--- a/src/interpreter/bytecode-array-builder.h
+++ b/src/interpreter/bytecode-array-builder.h
@@ -9,7 +9,9 @@
#include "src/ast.h"
#include "src/frames.h"
+#include "src/heap/identity-map.h"
#include "src/interpreter/bytecodes.h"
+#include "src/zone.h"
namespace v8 {
namespace internal {
@@ -22,7 +24,7 @@ class Register;
class BytecodeArrayBuilder {
public:
- explicit BytecodeArrayBuilder(Isolate* isolate);
+ explicit BytecodeArrayBuilder(Isolate* isolate, Zone* zone);
Michael Starzinger 2015/08/28 12:21:04 nit: No longer needs to be marked as explicit.
rmcilroy 2015/08/28 14:42:05 Done.
Handle<BytecodeArray> ToBytecodeArray();
// Set number of parameters expected by function.
@@ -37,6 +39,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,6 +70,8 @@ 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);
@@ -74,6 +79,9 @@ class BytecodeArrayBuilder {
std::vector<uint8_t> bytecodes_;
Michael Starzinger 2015/08/28 12:21:04 Same comment from below applies here.
rmcilroy 2015/08/28 14:42:05 Done.
bool bytecode_generated_;
+ IdentityMap<size_t> constants_map_;
+ std::vector<Handle<Object>> constants_;
Michael Starzinger 2015/08/28 12:21:04 Could we use a ZoneVector here, that would provide
rmcilroy 2015/08/28 14:42:05 Done.
+
int parameter_count_;
int local_register_count_;
int temporary_register_count_;

Powered by Google App Engine
This is Rietveld 408576698