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

Unified Diff: runtime/vm/report.cc

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. Created 4 years, 8 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 | « runtime/vm/regexp_test.cc ('k') | runtime/vm/resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/report.cc
diff --git a/runtime/vm/report.cc b/runtime/vm/report.cc
index 01b7a86822f0e7a308522dd8441ab59535944d55..b53c4942afd5b25b6605107d76d1349b9b74edf0 100644
--- a/runtime/vm/report.cc
+++ b/runtime/vm/report.cc
@@ -43,7 +43,7 @@ RawString* Report::PrependSnippet(Kind kind,
// Only report the line position if we have the original source. We still
// need to get a valid column so that we can report the ^ mark below the
// snippet.
- // Allocate formatted strings in old sapce as they may be created during
+ // Allocate formatted strings in old space as they may be created during
// optimizing compilation. Those strings are created rarely and should not
// polute old space.
if (script.HasSource()) {
@@ -61,24 +61,23 @@ RawString* Report::PrependSnippet(Kind kind,
line);
}
// Append the formatted error or warning message.
- GrowableHandlePtrArray<const String> strs(Thread::Current()->zone(), 5);
- strs.Add(result);
- strs.Add(message);
+ const Array& strs = Array::Handle(
+ Array::New(6, Heap::kOld));
+ strs.SetAt(0, result);
+ strs.SetAt(1, message);
// Append the source line.
const String& script_line = String::Handle(
script.GetLine(line, Heap::kOld));
ASSERT(!script_line.IsNull());
- strs.Add(Symbols::NewLine());
- strs.Add(script_line);
- strs.Add(Symbols::NewLine());
+ strs.SetAt(2, Symbols::NewLine());
+ strs.SetAt(3, script_line);
+ strs.SetAt(4, Symbols::NewLine());
// Append the column marker.
const String& column_line = String::Handle(
String::NewFormatted(Heap::kOld,
"%*s\n", static_cast<int>(column), "^"));
- strs.Add(column_line);
- // TODO(srdjan): Use Strings::FromConcatAll in old space, once
- // implemented.
- result = Symbols::FromConcatAll(strs);
+ strs.SetAt(5, column_line);
+ result = String::ConcatAll(strs, Heap::kOld);
} else {
// Token position is unknown.
result = String::NewFormatted(Heap::kOld, "'%s': %s: ",
« no previous file with comments | « runtime/vm/regexp_test.cc ('k') | runtime/vm/resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698