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

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

Issue 2167763003: [Interpreter] Avoid allocating pairs array in VisitDeclarations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_merge_binary
Patch Set: Rebase Created 4 years, 5 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/interpreter/bytecode-generator.cc ('k') | src/interpreter/constant-array-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/constant-array-builder.h
diff --git a/src/interpreter/constant-array-builder.h b/src/interpreter/constant-array-builder.h
index 1a68646251f1f4360f72668bb91ff9fb48593de6..2e4445af4110684c8fd4ba0023e83d4f4b44ce03 100644
--- a/src/interpreter/constant-array-builder.h
+++ b/src/interpreter/constant-array-builder.h
@@ -48,6 +48,13 @@ class ConstantArrayBuilder final BASE_EMBEDDED {
// present. Returns the array index associated with the object.
size_t Insert(Handle<Object> object);
+ // Allocates an empty entry and returns the array index associated with the
+ // reservation. Entry can be inserted by calling InsertReservedEntry().
+ size_t AllocateEntry();
+
+ // Inserts the given object into an allocated entry.
+ void InsertAllocatedEntry(size_t index, Handle<Object> object);
+
// Creates a reserved entry in the constant pool and returns
// the size of the operand that'll be required to hold the entry
// when committed.
@@ -64,6 +71,7 @@ class ConstantArrayBuilder final BASE_EMBEDDED {
typedef uint32_t index_t;
index_t AllocateEntry(Handle<Object> object);
+ index_t AllocateIndex(Handle<Object> object);
struct ConstantArraySlice final : public ZoneObject {
ConstantArraySlice(Zone* zone, size_t start_index, size_t capacity,
@@ -72,6 +80,7 @@ class ConstantArrayBuilder final BASE_EMBEDDED {
void Unreserve();
size_t Allocate(Handle<Object> object);
Handle<Object> At(size_t index) const;
+ void InsertAt(size_t index, Handle<Object> object);
inline size_t available() const { return capacity() - reserved() - size(); }
inline size_t reserved() const { return reserved_; }
@@ -91,7 +100,7 @@ class ConstantArrayBuilder final BASE_EMBEDDED {
DISALLOW_COPY_AND_ASSIGN(ConstantArraySlice);
};
- const ConstantArraySlice* IndexToSlice(size_t index) const;
+ ConstantArraySlice* IndexToSlice(size_t index) const;
ConstantArraySlice* OperandSizeToSlice(OperandSize operand_size) const;
IdentityMap<index_t>* constants_map() { return &constants_map_; }
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/constant-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698