Reviewers: Michael Starzinger,
Message:
Hi Michael, here is the thing I mentioned at lunch, thx!
--Michael
Description:
VectorICs: VisitClassLiteral needs adjustment for IC slot usage.
Also, generic lowering for keyed stores needs to handle the case when
there is no IC slot available (it can use the generic keyed store).
BUG=
[email protected]
Please review this at https://codereview.chromium.org/1252303002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+24, -10 lines):
M src/compiler/ast-graph-builder.cc
M src/compiler/js-generic-lowering.cc
M src/full-codegen.cc
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc
b/src/compiler/ast-graph-builder.cc
index
5c3d2c5318f9cf9142f2f188375ca2627d5624e0..5e16c269674957c34591bd92bbf2932170a6f8b6
100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1663,9 +1663,10 @@ void
AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
DCHECK_NOT_NULL(expr->class_variable_proxy());
Variable* var = expr->class_variable_proxy()->var();
FrameStateBeforeAndAfter states(this, BailoutId::None());
- VectorSlotPair feedback = CreateVectorSlotPair(
- FLAG_vector_stores ? expr->GetNthSlot(store_slot_index++)
- : FeedbackVectorICSlot::Invalid());
+ VectorSlotPair feedback =
+ CreateVectorSlotPair(FLAG_vector_stores && var->IsUnallocated()
+ ? expr->GetNthSlot(store_slot_index++)
+ : FeedbackVectorICSlot::Invalid());
BuildVariableAssignment(var, literal, Token::INIT_CONST, feedback,
BailoutId::None(), states);
}
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc
b/src/compiler/js-generic-lowering.cc
index
e3e4cddd8a3697723d31b376527f2b876153ca56..9bd38e87a2f7fc7476d43051433bcf0793d2b9a7
100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -359,11 +359,22 @@ void JSGenericLowering::LowerJSStoreProperty(Node*
node) {
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
const StorePropertyParameters& p = StorePropertyParametersOf(node->op());
LanguageMode language_mode = OpParameter<LanguageMode>(node);
- Callable callable = CodeFactory::KeyedStoreICInOptimizedCode(
- isolate(), language_mode, UNINITIALIZED);
+ InlineCacheState state = FLAG_vector_stores && p.feedback().index() == -1
+ ? MEGAMORPHIC
+ : UNINITIALIZED;
+ Callable callable =
+ CodeFactory::KeyedStoreICInOptimizedCode(isolate(), language_mode,
state);
if (FLAG_vector_stores) {
- DCHECK(p.feedback().index() != -1);
- node->InsertInput(zone(), 3,
jsgraph()->SmiConstant(p.feedback().index()));
+ if (state == MEGAMORPHIC) {
+ // We have a special case where we do keyed stores but don't have a
type
+ // feedback vector slot allocated to support it. In this case,
install
+ // the megamorphic keyed store stub which needs neither vector nor
slot.
+ node->RemoveInput(3);
+ } else {
+ DCHECK(p.feedback().index() != -1);
+ node->InsertInput(zone(), 3,
+ jsgraph()->SmiConstant(p.feedback().index()));
+ }
} else {
node->RemoveInput(3);
}
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index
2d7f6e8af7e606c13488a5b01807947521290383..a57a5bd01e456c2d90476a761df0ec318271d395
100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -1310,9 +1310,11 @@ void
FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
if (lit->scope() != NULL) {
DCHECK_NOT_NULL(lit->class_variable_proxy());
- FeedbackVectorICSlot slot = FLAG_vector_stores
- ? lit->GetNthSlot(store_slot_index++)
- : FeedbackVectorICSlot::Invalid();
+ FeedbackVectorICSlot slot =
+ FLAG_vector_stores &&
+ lit->class_variable_proxy()->var()->IsUnallocated()
+ ? lit->GetNthSlot(store_slot_index++)
+ : FeedbackVectorICSlot::Invalid();
EmitVariableAssignment(lit->class_variable_proxy()->var(),
Token::INIT_CONST, slot);
}
--
--
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.