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

Unified Diff: runtime/vm/code_generator_x64.cc

Issue 9186058: Make the "sticky error" an Error instead of a String. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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 | « runtime/vm/code_generator_ia32.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_x64.cc
===================================================================
--- runtime/vm/code_generator_x64.cc (revision 3366)
+++ runtime/vm/code_generator_x64.cc (working copy)
@@ -2311,12 +2311,12 @@
// TODO(regis): Temporary type should be allocated in new gen heap.
Type& type = Type::Handle(
Type::NewParameterizedType(instantiator_class, type_arguments));
- String& errmsg = String::Handle();
+ Error& error = Error::Handle();
type ^= ClassFinalizer::FinalizeAndCanonicalizeType(instantiator_class,
type,
- &errmsg);
- if (!errmsg.IsNull()) {
- ErrorMsg(token_index, errmsg.ToCString());
+ &error);
+ if (!error.IsNull()) {
+ ErrorMsg(token_index, error.ToErrorCString());
}
type_arguments = type.arguments();
__ PushObject(type_arguments);
@@ -2791,17 +2791,14 @@
void CodeGenerator::ErrorMsg(intptr_t token_index, const char* format, ...) {
- const intptr_t kMessageBufferSize = 512;
- char message_buffer[kMessageBufferSize];
va_list args;
va_start(args, format);
const Class& cls = Class::Handle(parsed_function_.function().owner());
const Script& script = Script::Handle(cls.script());
- Parser::FormatMessage(script, token_index, "Error",
- message_buffer, kMessageBufferSize,
- format, args);
+ const Error& error = Error::Handle(
+ Parser::FormatError(script, token_index, "Error", format, args));
va_end(args);
- Isolate::Current()->long_jump_base()->Jump(1, message_buffer);
+ Isolate::Current()->long_jump_base()->Jump(1, error);
UNREACHABLE();
}
« no previous file with comments | « runtime/vm/code_generator_ia32.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698