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

Side by Side Diff: src/isolate.h

Issue 995013005: Simplify pending message script handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix hardcoded constant. 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 unified diff | Download patch
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_ISOLATE_H_ 5 #ifndef V8_ISOLATE_H_
6 #define V8_ISOLATE_H_ 6 #define V8_ISOLATE_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include "include/v8-debug.h" 9 #include "include/v8-debug.h"
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 Context* pending_handler_context_; 278 Context* pending_handler_context_;
279 Code* pending_handler_code_; 279 Code* pending_handler_code_;
280 intptr_t pending_handler_offset_; 280 intptr_t pending_handler_offset_;
281 Address pending_handler_fp_; 281 Address pending_handler_fp_;
282 Address pending_handler_sp_; 282 Address pending_handler_sp_;
283 283
284 // Communication channel between Isolate::Throw and message consumers. 284 // Communication channel between Isolate::Throw and message consumers.
285 bool has_pending_message_; 285 bool has_pending_message_;
286 bool rethrowing_message_; 286 bool rethrowing_message_;
287 Object* pending_message_obj_; 287 Object* pending_message_obj_;
288 Object* pending_message_script_;
289 288
290 // Use a separate value for scheduled exceptions to preserve the 289 // Use a separate value for scheduled exceptions to preserve the
291 // invariants that hold about pending_exception. We may want to 290 // invariants that hold about pending_exception. We may want to
292 // unify them later. 291 // unify them later.
293 Object* scheduled_exception_; 292 Object* scheduled_exception_;
294 bool external_caught_exception_; 293 bool external_caught_exception_;
295 SaveContext* save_context_; 294 SaveContext* save_context_;
296 v8::TryCatch* catcher_; 295 v8::TryCatch* catcher_;
297 296
298 // Stack. 297 // Stack.
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 THREAD_LOCAL_TOP_ADDRESS(Code*, pending_handler_code) 600 THREAD_LOCAL_TOP_ADDRESS(Code*, pending_handler_code)
602 THREAD_LOCAL_TOP_ADDRESS(intptr_t, pending_handler_offset) 601 THREAD_LOCAL_TOP_ADDRESS(intptr_t, pending_handler_offset)
603 THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_fp) 602 THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_fp)
604 THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_sp) 603 THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_sp)
605 604
606 THREAD_LOCAL_TOP_ACCESSOR(bool, external_caught_exception) 605 THREAD_LOCAL_TOP_ACCESSOR(bool, external_caught_exception)
607 606
608 void clear_pending_message() { 607 void clear_pending_message() {
609 thread_local_top_.has_pending_message_ = false; 608 thread_local_top_.has_pending_message_ = false;
610 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); 609 thread_local_top_.pending_message_obj_ = heap_.the_hole_value();
611 thread_local_top_.pending_message_script_ = heap_.the_hole_value();
612 } 610 }
613 v8::TryCatch* try_catch_handler() { 611 v8::TryCatch* try_catch_handler() {
614 return thread_local_top_.try_catch_handler(); 612 return thread_local_top_.try_catch_handler();
615 } 613 }
616 Address try_catch_handler_address() { 614 Address try_catch_handler_address() {
617 return thread_local_top_.try_catch_handler_address(); 615 return thread_local_top_.try_catch_handler_address();
618 } 616 }
619 bool* external_caught_exception_address() { 617 bool* external_caught_exception_address() {
620 return &thread_local_top_.external_caught_exception_; 618 return &thread_local_top_.external_caught_exception_;
621 } 619 }
622 620
623 THREAD_LOCAL_TOP_ACCESSOR(v8::TryCatch*, catcher) 621 THREAD_LOCAL_TOP_ACCESSOR(v8::TryCatch*, catcher)
624 622
625 THREAD_LOCAL_TOP_ADDRESS(Object*, scheduled_exception) 623 THREAD_LOCAL_TOP_ADDRESS(Object*, scheduled_exception)
626 624
627 Address pending_message_obj_address() { 625 Address pending_message_obj_address() {
628 return reinterpret_cast<Address>(&thread_local_top_.pending_message_obj_); 626 return reinterpret_cast<Address>(&thread_local_top_.pending_message_obj_);
629 } 627 }
630 628
631 Address has_pending_message_address() { 629 Address has_pending_message_address() {
632 return reinterpret_cast<Address>(&thread_local_top_.has_pending_message_); 630 return reinterpret_cast<Address>(&thread_local_top_.has_pending_message_);
633 } 631 }
634 632
635 Address pending_message_script_address() {
636 return reinterpret_cast<Address>(
637 &thread_local_top_.pending_message_script_);
638 }
639
640 Object* scheduled_exception() { 633 Object* scheduled_exception() {
641 DCHECK(has_scheduled_exception()); 634 DCHECK(has_scheduled_exception());
642 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); 635 DCHECK(!thread_local_top_.scheduled_exception_->IsException());
643 return thread_local_top_.scheduled_exception_; 636 return thread_local_top_.scheduled_exception_;
644 } 637 }
645 bool has_scheduled_exception() { 638 bool has_scheduled_exception() {
646 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); 639 DCHECK(!thread_local_top_.scheduled_exception_->IsException());
647 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); 640 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value();
648 } 641 }
649 void clear_scheduled_exception() { 642 void clear_scheduled_exception() {
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 } 1585 }
1593 1586
1594 EmbeddedVector<char, 128> filename_; 1587 EmbeddedVector<char, 128> filename_;
1595 FILE* file_; 1588 FILE* file_;
1596 int scope_depth_; 1589 int scope_depth_;
1597 }; 1590 };
1598 1591
1599 } } // namespace v8::internal 1592 } } // namespace v8::internal
1600 1593
1601 #endif // V8_ISOLATE_H_ 1594 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698