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: runtime/vm/exceptions.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/dart_entry_test.cc ('k') | runtime/vm/find_code_object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 4e8b6fb9dca678975761f5e293d0a3292b145cd3..a2158519eaae40462f223190c6792bdd421b7cb5 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -420,7 +420,10 @@ RawScript* Exceptions::GetCallerScript(DartFrameIterator* iterator) {
// TODO(hausner): Rename this NewCoreInstance to call out the fact that
// the class name is resolved in the core library implicitly?
RawInstance* Exceptions::NewInstance(const char* class_name) {
- const String& cls_name = String::Handle(Symbols::New(class_name));
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ const String& cls_name = String::Handle(zone,
+ Symbols::New(thread, class_name));
const Library& core_lib = Library::Handle(Library::CoreLibrary());
// No ambiguity error expected: passing NULL.
Class& cls = Class::Handle(core_lib.LookupClass(cls_name));
@@ -460,7 +463,8 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
args.SetAt(2, Smi::Handle(zone, Smi::New(column)));
// Construct '_errorMsg'.
- GrowableHandlePtrArray<const String> pieces(zone, 20);
+ const GrowableObjectArray& pieces = GrowableObjectArray::Handle(zone,
+ GrowableObjectArray::New(20));
// Print bound error first, if any.
if (!bound_error_msg.IsNull() && (bound_error_msg.Length() > 0)) {
@@ -473,7 +477,7 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
const LanguageError& error = LanguageError::Handle(zone, dst_type.error());
if (!error.IsNull()) {
// Print the embedded error only.
- pieces.Add(String::Handle(zone, Symbols::New(error.ToErrorCString())));
+ pieces.Add(String::Handle(zone, String::New(error.ToErrorCString())));
pieces.Add(Symbols::NewLine());
} else {
// Describe the type error.
@@ -515,8 +519,8 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
}
}
}
- const String& error_msg =
- String::Handle(zone, Symbols::FromConcatAll(pieces));
+ const Array& arr = Array::Handle(zone, Array::MakeArray(pieces));
+ const String& error_msg = String::Handle(zone, String::ConcatAll(arr));
args.SetAt(3, error_msg);
// Type errors in the core library may be difficult to diagnose.
« no previous file with comments | « runtime/vm/dart_entry_test.cc ('k') | runtime/vm/find_code_object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698