Reviewers: Weiliang,
Message:
PTAL.
Description:
X87: Vector ICs: ClassLiterals need to allocate a vector slot for home
objects.
port b27016b78a7dd58dc682eed51500ba603b3e46b0 (r28827).
original commit message:
BUG=
Please review this at https://codereview.chromium.org/1178533002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+12, -3 lines):
M src/x87/full-codegen-x87.cc
Index: src/x87/full-codegen-x87.cc
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
index
2cb448ae2beb7f7284dadbf257c1b938e3b09c9d..4220734a9918ae3f3fa5d5f473ce38297c92968f
100644
--- a/src/x87/full-codegen-x87.cc
+++ b/src/x87/full-codegen-x87.cc
@@ -1606,9 +1606,9 @@ void
FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
AccessorTable accessor_table(zone());
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
- // 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;
for (; property_index < expr->properties()->length(); property_index++) {
ObjectLiteral::Property* property =
expr->properties()->at(property_index);
@@ -2470,6 +2470,10 @@ void
FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
__ mov(scratch, FieldOperand(eax,
JSFunction::kPrototypeOrInitialMapOffset));
__ 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++) {
ObjectLiteral::Property* property = lit->properties()->at(i);
Expression* value = property->value();
@@ -2491,7 +2495,8 @@ void
FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
}
VisitForStackValue(value);
- EmitSetHomeObjectIfNeeded(value, 2);
+ EmitSetHomeObjectIfNeeded(value, 2,
+ lit->SlotForHomeObject(value,
&store_slot_index));
switch (property->kind()) {
case ObjectLiteral::Property::CONSTANT:
@@ -2519,6 +2524,10 @@ void
FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
// constructor
__ 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());
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.