Commit 3df35e3f authored by cdai2's avatar cdai2

X87: Vector ICs: ClassLiterals need to allocate a vector slot for home objects.

port b27016b7 (r28827).

original commit message:

BUG=
R=weiliang.lin@intel.com

Review URL: https://codereview.chromium.org/1178533002

Cr-Commit-Position: refs/heads/master@{#28951}
parent 2dd269f3
...@@ -1601,9 +1601,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1601,9 +1601,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
AccessorTable accessor_table(zone()); AccessorTable accessor_table(zone());
int property_index = 0; int property_index = 0;
// store_slot_index points to the vector ic slot for the next store ic used. // store_slot_index points to the vector IC slot for the next store IC used.
// ObjectLiteral::ComputeFeedbackRequirements controls the allocation of slots // ObjectLiteral::ComputeFeedbackRequirements controls the allocation of slots
// and must be updated if the number of store ics emitted here changes. // and must be updated if the number of store ICs emitted here changes.
int store_slot_index = 0; int store_slot_index = 0;
for (; property_index < expr->properties()->length(); property_index++) { for (; property_index < expr->properties()->length(); property_index++) {
ObjectLiteral::Property* property = expr->properties()->at(property_index); ObjectLiteral::Property* property = expr->properties()->at(property_index);
...@@ -2465,6 +2465,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { ...@@ -2465,6 +2465,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
__ mov(scratch, FieldOperand(eax, JSFunction::kPrototypeOrInitialMapOffset)); __ mov(scratch, FieldOperand(eax, JSFunction::kPrototypeOrInitialMapOffset));
__ Push(scratch); __ Push(scratch);
// store_slot_index points to the vector IC slot for the next store IC used.
// ClassLiteral::ComputeFeedbackRequirements controls the allocation of slots
// and must be updated if the number of store ICs emitted here changes.
int store_slot_index = 0;
for (int i = 0; i < lit->properties()->length(); i++) { for (int i = 0; i < lit->properties()->length(); i++) {
ObjectLiteral::Property* property = lit->properties()->at(i); ObjectLiteral::Property* property = lit->properties()->at(i);
Expression* value = property->value(); Expression* value = property->value();
...@@ -2486,7 +2490,8 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { ...@@ -2486,7 +2490,8 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
} }
VisitForStackValue(value); VisitForStackValue(value);
EmitSetHomeObjectIfNeeded(value, 2); EmitSetHomeObjectIfNeeded(value, 2,
lit->SlotForHomeObject(value, &store_slot_index));
switch (property->kind()) { switch (property->kind()) {
case ObjectLiteral::Property::CONSTANT: case ObjectLiteral::Property::CONSTANT:
...@@ -2514,6 +2519,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { ...@@ -2514,6 +2519,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
// constructor // constructor
__ CallRuntime(Runtime::kToFastProperties, 1); __ CallRuntime(Runtime::kToFastProperties, 1);
// Verify that compilation exactly consumed the number of store ic slots that
// the ClassLiteral node had to offer.
DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment