From 37729a52fdf3eaa4789612559e955d23328a2b8f Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Tue, 10 Mar 2015 07:45:14 -0700 Subject: [PATCH] Simplify and correctify pending message location handling. This makes sure that the pending message location is only tracked by the message object, as only this is saved for finally-blocks. The location information is duplicated and becomes stale. R=titzer@chromium.org TEST=maeh, not so much. Review URL: https://codereview.chromium.org/987353002 Cr-Commit-Position: refs/heads/master@{#27109} --- include/v8.h | 2 -- src/api.cc | 2 -- src/isolate.cc | 20 ++++++++------------ src/isolate.h | 2 -- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/include/v8.h b/include/v8.h index 74b58bf..29a4287 100644 --- a/include/v8.h +++ b/include/v8.h @@ -6089,8 +6089,6 @@ class V8_EXPORT TryCatch { void* message_obj_; void* message_script_; void* js_stack_comparable_address_; - int message_start_pos_; - int message_end_pos_; bool is_verbose_ : 1; bool can_continue_ : 1; bool capture_message_ : 1; diff --git a/src/api.cc b/src/api.cc index 7468657..4ad0df2 100644 --- a/src/api.cc +++ b/src/api.cc @@ -2144,8 +2144,6 @@ void v8::TryCatch::ResetInternal() { exception_ = the_hole; message_obj_ = the_hole; message_script_ = the_hole; - message_start_pos_ = 0; - message_end_pos_ = 0; } diff --git a/src/isolate.cc b/src/isolate.cc index 34e4d00..23782cd 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 message_obj(thread_local_top_.pending_message_obj_, - this); + Handle message_obj( + JSMessageObject::cast(thread_local_top_.pending_message_obj_)); if (!thread_local_top_.pending_message_script_->IsTheHole()) { Handle