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

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

Issue 2225923003: [Interpreter] Collect type feedback for 'new' in the bytecode handler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updated mjsunit.status Created 4 years, 4 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
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 704f4e91e33d16c9d1a4b08158d2a3207a7dfa47..7a005b3c154b4a01626c328ed21d8f3870bd8369 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2691,7 +2691,7 @@ void BytecodeGenerator::VisitCall(Call* expr) {
if (expr->CallFeedbackICSlot().IsInvalid()) {
DCHECK(call_type == Call::POSSIBLY_EVAL_CALL);
// Valid type feedback slots can only be greater than kReservedIndexCount.
- // We use 0 to indicate an invalid slot it. Statically assert that 0 cannot
+ // We use 0 to indicate an invalid slot id. Statically assert that 0 cannot
// be a valid slot id.
STATIC_ASSERT(TypeFeedbackVector::kReservedIndexCount > 0);
feedback_slot_index = 0;
@@ -2726,7 +2726,13 @@ void BytecodeGenerator::VisitCallSuper(Call* expr) {
// Call construct.
builder()->SetExpressionPosition(expr);
- builder()->New(constructor, first_arg, args->length());
+ // 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, first_arg, args->length(), 0);
execution_result()->SetResultInAccumulator();
}
@@ -2743,7 +2749,8 @@ void BytecodeGenerator::VisitCallNew(CallNew* expr) {
// constructor for CallNew.
builder()
->LoadAccumulatorWithRegister(constructor)
- .New(constructor, first_arg, args->length());
+ .New(constructor, first_arg, args->length(),
+ feedback_index(expr->CallNewFeedbackSlot()));
execution_result()->SetResultInAccumulator();
}

Powered by Google App Engine
This is Rietveld 408576698