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

Unified Diff: src/deoptimizer.cc

Issue 919173003: During arguments materialization, do not store materialized objects without lazy deopt. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « src/deoptimizer.h ('k') | test/mjsunit/regress/regress-arg-materialize-store.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index 7c79c89078b98a74e8d65bfb766e2670a8850ba4..df8e5cffa8f8f052c94e8fe942069a963975bd4c 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -3190,7 +3190,10 @@ SlotRef SlotRefValueBuilder::ComputeSlotForNextArgument(
SlotRefValueBuilder::SlotRefValueBuilder(JavaScriptFrame* frame,
int inlined_jsframe_index,
int formal_parameter_count)
- : current_slot_(0), args_length_(-1), first_slot_index_(-1) {
+ : current_slot_(0),
+ args_length_(-1),
+ first_slot_index_(-1),
+ should_deoptimize_(false) {
DisallowHeapAllocation no_gc;
int deopt_index = Safepoint::kNoDeoptimizationIndex;
@@ -3208,7 +3211,6 @@ SlotRefValueBuilder::SlotRefValueBuilder(JavaScriptFrame* frame,
CHECK_GT(jsframe_count, inlined_jsframe_index);
int jsframes_to_skip = inlined_jsframe_index;
int number_of_slots = -1; // Number of slots inside our frame (yet unknown)
- bool should_deopt = false;
while (number_of_slots != 0) {
opcode = static_cast<Translation::Opcode>(it.Next());
bool processed = false;
@@ -3265,7 +3267,7 @@ SlotRefValueBuilder::SlotRefValueBuilder(JavaScriptFrame* frame,
number_of_slots += slot.GetChildrenCount();
if (slot.Representation() == SlotRef::DEFERRED_OBJECT ||
slot.Representation() == SlotRef::DUPLICATE_OBJECT) {
- should_deopt = true;
+ should_deoptimize_ = true;
}
}
@@ -3276,7 +3278,7 @@ SlotRefValueBuilder::SlotRefValueBuilder(JavaScriptFrame* frame,
it.Skip(Translation::NumberOfOperandsFor(opcode));
}
}
- if (should_deopt) {
+ if (should_deoptimize_) {
List<JSFunction*> functions(2);
frame->GetFunctions(&functions);
Deoptimizer::DeoptimizeFunction(functions[0]);
@@ -3492,9 +3494,11 @@ void SlotRefValueBuilder::Finish(Isolate* isolate) {
// We should have processed all the slots
CHECK_EQ(slot_refs_.length(), current_slot_);
- if (materialized_objects_.length() > prev_materialized_count_) {
- // We have materialized some new objects, so we have to store them
- // to prevent duplicate materialization
+ if (should_deoptimize_ &&
+ materialized_objects_.length() > prev_materialized_count_) {
+ // We have materialized some new objects and they might be accessible
+ // from the arguments object, so we have to store them
+ // to prevent duplicate materialization.
Handle<FixedArray> array = isolate->factory()->NewFixedArray(
materialized_objects_.length());
for (int i = 0; i < materialized_objects_.length(); i++) {
« no previous file with comments | « src/deoptimizer.h ('k') | test/mjsunit/regress/regress-arg-materialize-store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698