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

Unified Diff: src/hydrogen.cc

Issue 882973002: [turbofan] Improve JSON output (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ASAN Created 5 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
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 54007c524a6cd376a357770eaeaaa28b6e04af8f..cbed39efb13b21777e31f256f29922b796b64fe4 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3511,16 +3511,13 @@ int HGraph::TraceInlinedFunction(
os << "--- FUNCTION SOURCE (" << shared->DebugName()->ToCString().get()
<< ") id{" << info()->optimization_id() << "," << id << "} ---\n";
{
- StringCharacterStream stream(String::cast(script->source()),
- shared->start_position());
- // fun->end_position() points to the last character in the stream. We
- // need to compensate by adding one to calculate the length.
- int source_len =
- shared->end_position() - shared->start_position() + 1;
- for (int i = 0; i < source_len; i++) {
- if (stream.HasMore()) {
- os << AsReversiblyEscapedUC16(stream.GetNext());
- }
+ DisallowHeapAllocation no_allocation;
+ int start = shared->start_position();
+ int len = shared->end_position() - start + 1;
+ String::SubStringRange source(String::cast(script->source()), start,
+ len);
+ for (const auto& c : source) {
+ os << AsReversiblyEscapedUC16(c);
}
}
« src/compiler/pipeline.cc ('K') | « src/compiler/pipeline.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698