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

Unified Diff: src/factory.cc

Issue 1131783003: 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
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 0e66ec6268268f42b439a2acdf03693900266749..22d630eaa3046084dc85a8a2ef534419160129e8 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -126,28 +126,6 @@ Handle<FixedArrayBase> Factory::NewFixedDoubleArrayWithHoles(
}
-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);
-}
-
-
Handle<OrderedHashSet> Factory::NewOrderedHashSet() {
return OrderedHashSet::Allocate(isolate(), OrderedHashSet::kMinCapacity);
}
@@ -1023,14 +1001,6 @@ Handle<FixedDoubleArray> Factory::CopyFixedDoubleArray(
}
-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
@@ -1507,8 +1477,6 @@ 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());
// Compute size.
int body_size = RoundUp(desc.instr_size, kObjectAlignment);
@@ -1535,6 +1503,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);
}
@@ -1544,9 +1515,6 @@ 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);
-
// Allow self references to created code object by patching the handle to
// point to the newly allocated Code object.
if (!self_ref.is_null()) *(self_ref.location()) = *code;

Powered by Google App Engine
This is Rietveld 408576698