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

Unified Diff: vm/exceptions.cc

Issue 11667012: Convert all symbols accessor to return read only handles so that it is not necessary to create a ne… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 12 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: vm/exceptions.cc
===================================================================
--- vm/exceptions.cc (revision 16583)
+++ vm/exceptions.cc (working copy)
@@ -393,58 +393,58 @@
RawObject* Exceptions::Create(ExceptionType type, const Array& arguments) {
Library& library = Library::Handle();
- String& class_name = String::Handle();
+ const String* class_name = NULL;
switch (type) {
case kNone:
UNREACHABLE();
break;
case kRange:
library = Library::CoreLibrary();
- class_name = Symbols::New("RangeError");
+ class_name = &Symbols::RangeError();
break;
case kArgument:
library = Library::CoreLibrary();
- class_name = Symbols::New("ArgumentError");
+ class_name = &Symbols::ArgumentError();
break;
case kNoSuchMethod:
library = Library::CoreLibrary();
- class_name = Symbols::New("NoSuchMethodError");
+ class_name = &Symbols::NoSuchMethodError();
break;
case kFormat:
library = Library::CoreLibrary();
- class_name = Symbols::New("FormatException");
+ class_name = &Symbols::FormatException();
break;
case kStackOverflow:
library = Library::CoreLibrary();
- class_name = Symbols::New("StackOverflowError");
+ class_name = &Symbols::StackOverflowError();
break;
case kOutOfMemory:
library = Library::CoreLibrary();
- class_name = Symbols::New("OutOfMemoryError");
+ class_name = &Symbols::OutOfMemoryError();
break;
case kInternalError:
library = Library::CoreLibrary();
- class_name = Symbols::New("InternalError");
+ class_name = &Symbols::InternalError();
break;
case kNullThrown:
library = Library::CoreLibrary();
- class_name = Symbols::New("NullThrownError");
+ class_name = &Symbols::NullThrownError();
break;
case kIllegalJSRegExp:
library = Library::CoreLibrary();
- class_name = Symbols::New("IllegalJSRegExpException");
+ class_name = &Symbols::IllegalJSRegExpException();
break;
case kIsolateSpawn:
library = Library::IsolateLibrary();
- class_name = Symbols::New("IsolateSpawnException");
+ class_name = &Symbols::IsolateSpawnException();
break;
case kIsolateUnhandledException:
library = Library::IsolateLibrary();
- class_name = Symbols::New("IsolateUnhandledException");
+ class_name = &Symbols::IsolateUnhandledException();
break;
}
- return DartLibraryCalls::ExceptionCreate(library, class_name, arguments);
+ return DartLibraryCalls::ExceptionCreate(library, *class_name, arguments);
}
} // namespace dart
« no previous file with comments | « vm/debugger_api_impl.cc ('k') | vm/flow_graph_builder.cc » ('j') | vm/symbols.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698