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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2419423002: [ignition] Collect feedback for super constructor calls. (Closed)
Patch Set: REGOLDEN Created 4 years, 2 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
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/ClassAndSuperClass.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index fc5a4a4fa67c5a470aefee9b7dfe4b2d7600301e..c67e5d43f706b797a63f5fe9b77257d0fefefe69 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2501,13 +2501,14 @@ void BytecodeGenerator::VisitCallSuper(Call* expr) {
// Call construct.
builder()->SetExpressionPosition(expr);
- // Valid type feedback slots can only be greater than kReservedIndexCount.
- // Assert that 0 cannot be valid a valid slot id.
- STATIC_ASSERT(TypeFeedbackVector::kReservedIndexCount > 0);
- // Type feedback is not necessary for super constructor calls. The type
- // information can be inferred in most cases. Slot id 0 indicates type
- // feedback is not required.
- builder()->New(constructor, args, 0);
+ // TODO(turbofan): For now we do gather feedback on super constructor
+ // calls, utilizing the existing machinery to inline the actual call
+ // target and the JSCreate for the implicit receiver allocation. This
+ // is not an ideal solution for super constructor calls, but it gets
+ // the job done for now. In the long run we might want to revisit this
+ // and come up with a better way.
+ int const feedback_slot_index = feedback_index(expr->CallFeedbackICSlot());
+ builder()->New(constructor, args, feedback_slot_index);
}
void BytecodeGenerator::VisitCallNew(CallNew* expr) {
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/ClassAndSuperClass.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698