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

Unified Diff: src/messages.cc

Issue 12300018: Made Isolate a mandatory parameter for everything Handle-related. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed CreateCode calls. Be nicer to MIPS. Created 7 years, 10 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 | « src/messages.h ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index b6c10c55b950b25787330bbfae9abd0900c95051..b56e3f6919983bbb25e33a62321cfa02d1d92ab1 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -46,7 +46,7 @@ void MessageHandler::DefaultMessageReport(Isolate* isolate,
PrintF("%s\n", *str);
} else {
HandleScope scope(isolate);
- Handle<Object> data(loc->script()->name());
+ Handle<Object> data(loc->script()->name(), isolate);
SmartArrayPointer<char> data_str;
if (data->IsString())
data_str = Handle<String>::cast(data)->ToCString(DISALLOW_NULLS);
@@ -113,7 +113,7 @@ void MessageHandler::ReportMessage(Isolate* isolate,
if (isolate->has_pending_exception()) {
isolate->pending_exception()->ToObject(&exception_object);
}
- Handle<Object> exception_handle(exception_object);
+ Handle<Object> exception_handle(exception_object, isolate);
Isolate::ExceptionScope exception_scope(isolate);
isolate->clear_pending_exception();
@@ -149,28 +149,30 @@ void MessageHandler::ReportMessage(Isolate* isolate,
}
-Handle<String> MessageHandler::GetMessage(Handle<Object> data) {
+Handle<String> MessageHandler::GetMessage(Isolate* isolate,
+ Handle<Object> data) {
+ Factory* factory = isolate->factory();
Handle<String> fmt_str =
- FACTORY->LookupOneByteSymbol(STATIC_ASCII_VECTOR("FormatMessage"));
+ factory->LookupOneByteSymbol(STATIC_ASCII_VECTOR("FormatMessage"));
Handle<JSFunction> fun =
Handle<JSFunction>(
JSFunction::cast(
- Isolate::Current()->js_builtins_object()->
+ isolate->js_builtins_object()->
GetPropertyNoExceptionThrown(*fmt_str)));
Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data);
- Handle<Object> argv[] = { Handle<Object>(message->type()),
- Handle<Object>(message->arguments()) };
+ Handle<Object> argv[] = { Handle<Object>(message->type(), isolate),
+ Handle<Object>(message->arguments(), isolate) };
bool caught_exception;
Handle<Object> result =
Execution::TryCall(fun,
- Isolate::Current()->js_builtins_object(),
+ isolate->js_builtins_object(),
ARRAY_SIZE(argv),
argv,
&caught_exception);
if (caught_exception || !result->IsString()) {
- return FACTORY->LookupOneByteSymbol(STATIC_ASCII_VECTOR("<error>"));
+ return factory->LookupOneByteSymbol(STATIC_ASCII_VECTOR("<error>"));
}
Handle<String> result_string = Handle<String>::cast(result);
// A string that has been obtained from JS code in this way is
@@ -187,7 +189,7 @@ SmartArrayPointer<char> MessageHandler::GetLocalizedMessage(
Isolate* isolate,
Handle<Object> data) {
HandleScope scope(isolate);
- return GetMessage(data)->ToCString(DISALLOW_NULLS);
+ return GetMessage(isolate, data)->ToCString(DISALLOW_NULLS);
}
« no previous file with comments | « src/messages.h ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698