| 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.
|
|
|