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

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

Issue 2226333002: [Interpreter] Avoid allocating handles in bytecode-array-writer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_varchecks
Patch Set: [Interpreter] Avoid allocating handles in bytecode-array-writer Created 4 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/interpreter/bytecode-array-writer.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 24d4c3298a20624fdef46a73d9db30d2e19d3cdb..136f999b259acdcfbad8ff36f82662b28f14e7b9 100644
--- a/src/interpreter/constant-array-builder.h
+++ b/src/interpreter/constant-array-builder.h
@@ -61,8 +61,8 @@ class ConstantArrayBuilder final BASE_EMBEDDED {
OperandSize CreateReservedEntry();
// Commit reserved entry and returns the constant pool index for the
- // object.
- size_t CommitReservedEntry(OperandSize operand_size, Handle<Object> object);
+ // SMI value.
+ size_t CommitReservedEntry(OperandSize operand_size, Smi* value);
// Discards constant pool reservation.
void DiscardReservedEntry(OperandSize operand_size);
@@ -72,6 +72,7 @@ class ConstantArrayBuilder final BASE_EMBEDDED {
index_t AllocateEntry(Handle<Object> object);
index_t AllocateIndex(Handle<Object> object);
+ index_t AllocateReservedEntry(Smi* value);
struct ConstantArraySlice final : public ZoneObject {
ConstantArraySlice(Zone* zone, size_t start_index, size_t capacity,
@@ -107,6 +108,8 @@ class ConstantArrayBuilder final BASE_EMBEDDED {
Isolate* isolate_;
ConstantArraySlice* idx_slice_[3];
ZoneMap<Address, index_t> constants_map_;
+ ZoneMap<Smi*, index_t> smi_map_;
+ ZoneVector<std::pair<Smi*, index_t>> smi_pairs_;
};
} // namespace interpreter
« no previous file with comments | « src/interpreter/bytecode-array-writer.cc ('k') | src/interpreter/constant-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698