Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 558ef12684b5daf93e59d5eb2ab08d9cb469bac1..2f06129e83950a047c7ee9595306a2ea00ace81c 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -1187,13 +1187,18 @@ void BytecodeGraphBuilder::VisitCreateArrayLiteral() { |
Handle<FixedArray> constant_elements = Handle<FixedArray>::cast( |
bytecode_iterator().GetConstantForIndexOperand(0)); |
int literal_index = bytecode_iterator().GetIndexOperand(1); |
- int literal_flags = bytecode_iterator().GetFlagOperand(2); |
+ int bytecode_flags = bytecode_iterator().GetFlagOperand(2); |
+ int literal_flags = |
+ interpreter::CreateArrayLiteralFlags::FlagsBits::decode(bytecode_flags); |
// Disable allocation site mementos. Only unoptimized code will collect |
// feedback about allocation site. Once the code is optimized we expect the |
// data to converge. So, we disable allocation site mementos in optimized |
// code. We can revisit this when we have data to the contrary. |
literal_flags |= ArrayLiteral::kDisableMementos; |
- int number_of_elements = constant_elements->length(); |
+ // TODO(mstarzinger): Thread through number of elements. The below number is |
+ // only an estimate and does not match {ArrayLiteral::values::length}. |
+ int number_of_elements = |
+ FixedArrayBase::cast(constant_elements->get(1))->length(); |
Node* literal = NewNode( |
javascript()->CreateLiteralArray(constant_elements, literal_flags, |
literal_index, number_of_elements), |
@@ -1209,7 +1214,8 @@ void BytecodeGraphBuilder::VisitCreateObjectLiteral() { |
int bytecode_flags = bytecode_iterator().GetFlagOperand(2); |
int literal_flags = |
interpreter::CreateObjectLiteralFlags::FlagsBits::decode(bytecode_flags); |
- // TODO(mstarzinger): Thread through number of properties. |
+ // TODO(mstarzinger): Thread through number of properties. The below number is |
+ // only an estimate and does not match {ObjectLiteral::properties_count}. |
int number_of_properties = constant_properties->length() / 2; |
Node* literal = NewNode( |
javascript()->CreateLiteralObject(constant_properties, literal_flags, |