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

Unified Diff: src/isolate.cc

Issue 987353002: Simplify and correctify pending message location handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 34e4d007f8ff73c771830b5375da56437e379790..23782cd1cfc1405557277a05976de7cf501d1a43 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -990,8 +990,6 @@ Object* Isolate::Throw(Object* exception, MessageLocation* location) {
thread_local_top()->pending_message_obj_ = *message_obj;
thread_local_top()->pending_message_script_ = *location->script();
- thread_local_top()->pending_message_start_pos_ = location->start_pos();
- thread_local_top()->pending_message_end_pos_ = location->end_pos();
// If the abort-on-uncaught-exception flag is specified, abort on any
// exception not caught by JavaScript, even when an external handler is
@@ -1168,8 +1166,6 @@ void Isolate::RestorePendingMessageFromTryCatch(v8::TryCatch* handler) {
DCHECK(script->IsScript() || script->IsTheHole());
thread_local_top()->pending_message_obj_ = message;
thread_local_top()->pending_message_script_ = script;
- thread_local_top()->pending_message_start_pos_ = handler->message_start_pos_;
- thread_local_top()->pending_message_end_pos_ = handler->message_end_pos_;
}
@@ -1448,13 +1444,13 @@ void Isolate::ReportPendingMessages() {
thread_local_top_.has_pending_message_ = false;
if (!thread_local_top_.pending_message_obj_->IsTheHole()) {
HandleScope scope(this);
- Handle<Object> message_obj(thread_local_top_.pending_message_obj_,
- this);
+ Handle<JSMessageObject> message_obj(
+ JSMessageObject::cast(thread_local_top_.pending_message_obj_));
if (!thread_local_top_.pending_message_script_->IsTheHole()) {
Handle<Script> script(
Script::cast(thread_local_top_.pending_message_script_));
- int start_pos = thread_local_top_.pending_message_start_pos_;
- int end_pos = thread_local_top_.pending_message_end_pos_;
+ int start_pos = message_obj->start_position();
+ int end_pos = message_obj->end_position();
MessageLocation location(script, start_pos, end_pos);
MessageHandler::ReportMessage(this, &location, message_obj);
} else {
@@ -1473,10 +1469,12 @@ MessageLocation Isolate::GetMessageLocation() {
if (thread_local_top_.pending_exception_ != heap()->termination_exception() &&
thread_local_top_.has_pending_message_ &&
!thread_local_top_.pending_message_obj_->IsTheHole()) {
+ Handle<JSMessageObject> message_obj(
+ JSMessageObject::cast(thread_local_top_.pending_message_obj_));
Handle<Script> script(
Script::cast(thread_local_top_.pending_message_script_));
- int start_pos = thread_local_top_.pending_message_start_pos_;
- int end_pos = thread_local_top_.pending_message_end_pos_;
+ int start_pos = message_obj->start_position();
+ int end_pos = message_obj->end_position();
return MessageLocation(script, start_pos, end_pos);
}
@@ -2000,8 +1998,6 @@ bool Isolate::PropagatePendingExceptionToExternalTryCatch() {
handler->message_obj_ = thread_local_top_.pending_message_obj_;
handler->message_script_ = thread_local_top_.pending_message_script_;
- handler->message_start_pos_ = thread_local_top_.pending_message_start_pos_;
- handler->message_end_pos_ = thread_local_top_.pending_message_end_pos_;
}
return true;
}
« no previous file with comments | « src/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698