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

Unified Diff: src/heap/heap.cc

Issue 1314953004: [interpreter] Add constant_pool() to BytecodeArray. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_args
Patch Set: Fix store buffer. Created 5 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
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index c4960992b3889c098da756de5764f1443354772b..a189cc96f57f0c6d5380b50f2eeb19dff6276b25 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -2918,7 +2918,8 @@ bool Heap::CreateInitialMaps() {
set_empty_byte_array(byte_array);
BytecodeArray* bytecode_array;
- AllocationResult allocation = AllocateBytecodeArray(0, nullptr, 0, 0);
+ AllocationResult allocation =
+ AllocateBytecodeArray(0, nullptr, 0, 0, empty_fixed_array());
if (!allocation.To(&bytecode_array)) {
return false;
}
@@ -3518,10 +3519,13 @@ AllocationResult Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
AllocationResult Heap::AllocateBytecodeArray(int length,
const byte* const raw_bytecodes,
int frame_size,
- int parameter_count) {
+ int parameter_count,
+ FixedArray* constant_pool) {
if (length < 0 || length > BytecodeArray::kMaxLength) {
v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true);
}
+ // Bytecode array is pretenured, so constant pool array should be to.
+ DCHECK(!InNewSpace(constant_pool));
int size = BytecodeArray::SizeFor(length);
HeapObject* result;
@@ -3535,6 +3539,7 @@ AllocationResult Heap::AllocateBytecodeArray(int length,
instance->set_length(length);
instance->set_frame_size(frame_size);
instance->set_parameter_count(parameter_count);
+ instance->set_constant_pool(constant_pool);
CopyBytes(instance->GetFirstBytecodeAddress(), raw_bytecodes, length);
return result;
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | test/cctest/test-heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698