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

Unified Diff: src/factory.cc

Issue 1155703006: Revert of Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index d0e0b83f5605f0f00ff8964263768a3b5cac2b72..ed3afa593c3bbe80506a321226011cd7b65ea9f6 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -123,6 +123,28 @@
}
}
return array;
+}
+
+
+Handle<ConstantPoolArray> Factory::NewConstantPoolArray(
+ const ConstantPoolArray::NumberOfEntries& small) {
+ DCHECK(small.total_count() > 0);
+ CALL_HEAP_FUNCTION(
+ isolate(),
+ isolate()->heap()->AllocateConstantPoolArray(small),
+ ConstantPoolArray);
+}
+
+
+Handle<ConstantPoolArray> Factory::NewExtendedConstantPoolArray(
+ const ConstantPoolArray::NumberOfEntries& small,
+ const ConstantPoolArray::NumberOfEntries& extended) {
+ DCHECK(small.total_count() > 0);
+ DCHECK(extended.total_count() > 0);
+ CALL_HEAP_FUNCTION(
+ isolate(),
+ isolate()->heap()->AllocateExtendedConstantPoolArray(small, extended),
+ ConstantPoolArray);
}
@@ -1006,6 +1028,14 @@
}
+Handle<ConstantPoolArray> Factory::CopyConstantPoolArray(
+ Handle<ConstantPoolArray> array) {
+ CALL_HEAP_FUNCTION(isolate(),
+ isolate()->heap()->CopyConstantPoolArray(*array),
+ ConstantPoolArray);
+}
+
+
Handle<Object> Factory::NewNumber(double value,
PretenureFlag pretenure) {
// We need to distinguish the minus zero value and this cannot be
@@ -1426,6 +1456,8 @@
int prologue_offset,
bool is_debug) {
Handle<ByteArray> reloc_info = NewByteArray(desc.reloc_size, TENURED);
+ Handle<ConstantPoolArray> constant_pool =
+ desc.origin->NewConstantPool(isolate());
// Compute size.
int body_size = RoundUp(desc.instr_size, kObjectAlignment);
@@ -1452,9 +1484,6 @@
code->set_next_code_link(*undefined_value());
code->set_handler_table(*empty_fixed_array(), SKIP_WRITE_BARRIER);
code->set_prologue_offset(prologue_offset);
- if (FLAG_enable_embedded_constant_pool) {
- code->set_constant_pool_offset(desc.instr_size - desc.constant_pool_size);
- }
if (code->kind() == Code::OPTIMIZED_FUNCTION) {
code->set_marked_for_deoptimization(false);
}
@@ -1463,6 +1492,9 @@
DCHECK(code->kind() == Code::FUNCTION);
code->set_has_debug_break_slots(true);
}
+
+ desc.origin->PopulateConstantPool(*constant_pool);
+ code->set_constant_pool(*constant_pool);
// Allow self references to created code object by patching the handle to
// point to the newly allocated Code object.
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698