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

Unified Diff: src/factory.cc

Issue 1030353003: Enable constant pool support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 5dac6a1ada3454980e348caf6a76b8268d51ee0d..6eb27d62ceca4c07e06c080a27e3da46494a7b37 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1427,8 +1427,11 @@ Handle<Code> Factory::NewCode(const CodeDesc& desc,
int prologue_offset,
bool is_debug) {
Handle<ByteArray> reloc_info = NewByteArray(desc.reloc_size, TENURED);
- Handle<ConstantPoolArray> constant_pool =
- desc.origin->NewConstantPool(isolate());
+ Handle<ConstantPoolArray> constant_pool;
+
+ if (FLAG_enable_ool_constant_pool) {
+ constant_pool = desc.origin->NewConstantPool(isolate());
+ }
// Compute size.
int body_size = RoundUp(desc.instr_size, kObjectAlignment);
@@ -1455,6 +1458,9 @@ Handle<Code> Factory::NewCode(const CodeDesc& desc,
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);
}
@@ -1464,8 +1470,10 @@ Handle<Code> Factory::NewCode(const CodeDesc& desc,
code->set_has_debug_break_slots(true);
}
- desc.origin->PopulateConstantPool(*constant_pool);
- code->set_constant_pool(*constant_pool);
+ if (FLAG_enable_ool_constant_pool) {
+ 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.

Powered by Google App Engine
This is Rietveld 408576698