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

Unified Diff: src/deoptimizer.cc

Issue 2651553003: [deoptimizer] Materialize string iterators. (Closed)
Patch Set: Created 3 years, 11 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/mjsunit/regress/regress-683617.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 a22a696d9325560e6be09bc4b8d890b7132e94ca..04d7cb03180a088375f89b01e159f18ef8712cdc 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -3738,6 +3738,24 @@ Handle<Object> TranslatedState::MaterializeCapturedObjectAt(
object->set_object_map(*iterated_object_map);
return object;
}
+ case JS_STRING_ITERATOR_TYPE: {
+ Handle<JSStringIterator> object = Handle<JSStringIterator>::cast(
+ isolate_->factory()->NewJSObjectFromMap(map, NOT_TENURED));
+ slot->value_ = object;
+ // Initialize the index to zero to make the heap verifier happy.
+ object->set_index(0);
+ Handle<Object> properties = materializer.FieldAt(value_index);
+ Handle<Object> elements = materializer.FieldAt(value_index);
+ Handle<Object> iterated_string = materializer.FieldAt(value_index);
+ Handle<Object> next_index = materializer.FieldAt(value_index);
+ object->set_properties(FixedArray::cast(*properties));
+ object->set_elements(FixedArrayBase::cast(*elements));
+ CHECK(iterated_string->IsString());
+ object->set_string(String::cast(*iterated_string));
+ CHECK(next_index->IsSmi());
+ object->set_index(Smi::cast(*next_index)->value());
+ return object;
+ }
case JS_ARRAY_TYPE: {
Handle<JSArray> object = Handle<JSArray>::cast(
isolate_->factory()->NewJSObjectFromMap(map, NOT_TENURED));
@@ -3886,7 +3904,6 @@ Handle<Object> TranslatedState::MaterializeCapturedObjectAt(
case JS_MAP_TYPE:
case JS_SET_ITERATOR_TYPE:
case JS_MAP_ITERATOR_TYPE:
- case JS_STRING_ITERATOR_TYPE:
case JS_WEAK_MAP_TYPE:
case JS_WEAK_SET_TYPE:
case JS_PROMISE_CAPABILITY_TYPE:
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-683617.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698