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

Unified Diff: runtime/vm/exceptions.cc

Issue 328663008: Add support to trace warnings in TraceBuffer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | runtime/vm/trace_buffer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
===================================================================
--- runtime/vm/exceptions.cc (revision 37220)
+++ runtime/vm/exceptions.cc (working copy)
@@ -750,16 +750,18 @@
ASSERT(caller_frame != NULL);
ASSERT(FLAG_warn_on_javascript_compatibility);
if (FLAG_silent_warnings) return;
- const Code& caller_code = Code::Handle(caller_frame->LookupDartCode());
+ Isolate* isolate = Isolate::Current();
+ const Code& caller_code = Code::Handle(isolate,
+ caller_frame->LookupDartCode());
ASSERT(!caller_code.IsNull());
const uword caller_pc = caller_frame->pc();
const intptr_t token_pos = caller_code.GetTokenIndexOfPC(caller_pc);
- const Function& caller = Function::Handle(caller_code.function());
- const Script& script = Script::Handle(caller.script());
+ const Function& caller = Function::Handle(isolate, caller_code.function());
+ const Script& script = Script::Handle(isolate, caller.script());
va_list args;
va_start(args, format);
- const Error& error = Error::Handle(
- LanguageError::NewFormattedV(Error::Handle(), // No previous error.
+ const Error& error = Error::Handle(isolate,
+ LanguageError::NewFormattedV(Error::Handle(isolate), // No prev error.
script, token_pos, LanguageError::kWarning,
Heap::kNew, format, args));
va_end(args);
@@ -767,9 +769,12 @@
ThrowJavascriptCompatibilityError(error.ToErrorCString());
} else {
OS::Print("javascript compatibility warning: %s", error.ToErrorCString());
+ va_start(args, format);
+ TraceBuffer::TraceWarningV(isolate, script, token_pos, format, args);
+ va_end(args);
}
const Stacktrace& stacktrace =
- Stacktrace::Handle(Exceptions::CurrentStacktrace());
+ Stacktrace::Handle(isolate, Exceptions::CurrentStacktrace());
intptr_t idx = 0;
OS::Print("%s",
stacktrace.ToCStringInternal(&idx,
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | runtime/vm/trace_buffer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698