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

Side by Side Diff: src/isolate.h

Issue 998943003: Simplify pending message object handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 Object* pending_exception_; 275 Object* pending_exception_;
276 276
277 // Communication channel between Isolate::FindHandler and the CEntryStub. 277 // Communication channel between Isolate::FindHandler and the CEntryStub.
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_;
286 bool rethrowing_message_; 285 bool rethrowing_message_;
287 Object* pending_message_obj_; 286 Object* pending_message_obj_;
288 287
289 // Use a separate value for scheduled exceptions to preserve the 288 // Use a separate value for scheduled exceptions to preserve the
290 // invariants that hold about pending_exception. We may want to 289 // invariants that hold about pending_exception. We may want to
291 // unify them later. 290 // unify them later.
292 Object* scheduled_exception_; 291 Object* scheduled_exception_;
293 bool external_caught_exception_; 292 bool external_caught_exception_;
294 SaveContext* save_context_; 293 SaveContext* save_context_;
295 294
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 596
598 THREAD_LOCAL_TOP_ADDRESS(Context*, pending_handler_context) 597 THREAD_LOCAL_TOP_ADDRESS(Context*, pending_handler_context)
599 THREAD_LOCAL_TOP_ADDRESS(Code*, pending_handler_code) 598 THREAD_LOCAL_TOP_ADDRESS(Code*, pending_handler_code)
600 THREAD_LOCAL_TOP_ADDRESS(intptr_t, pending_handler_offset) 599 THREAD_LOCAL_TOP_ADDRESS(intptr_t, pending_handler_offset)
601 THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_fp) 600 THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_fp)
602 THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_sp) 601 THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_sp)
603 602
604 THREAD_LOCAL_TOP_ACCESSOR(bool, external_caught_exception) 603 THREAD_LOCAL_TOP_ACCESSOR(bool, external_caught_exception)
605 604
606 void clear_pending_message() { 605 void clear_pending_message() {
607 thread_local_top_.has_pending_message_ = false;
608 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); 606 thread_local_top_.pending_message_obj_ = heap_.the_hole_value();
609 } 607 }
610 v8::TryCatch* try_catch_handler() { 608 v8::TryCatch* try_catch_handler() {
611 return thread_local_top_.try_catch_handler(); 609 return thread_local_top_.try_catch_handler();
612 } 610 }
613 Address try_catch_handler_address() { 611 Address try_catch_handler_address() {
614 return thread_local_top_.try_catch_handler_address(); 612 return thread_local_top_.try_catch_handler_address();
615 } 613 }
616 bool* external_caught_exception_address() { 614 bool* external_caught_exception_address() {
617 return &thread_local_top_.external_caught_exception_; 615 return &thread_local_top_.external_caught_exception_;
618 } 616 }
619 617
620 THREAD_LOCAL_TOP_ADDRESS(Object*, scheduled_exception) 618 THREAD_LOCAL_TOP_ADDRESS(Object*, scheduled_exception)
621 619
622 Address pending_message_obj_address() { 620 Address pending_message_obj_address() {
623 return reinterpret_cast<Address>(&thread_local_top_.pending_message_obj_); 621 return reinterpret_cast<Address>(&thread_local_top_.pending_message_obj_);
624 } 622 }
625 623
626 Address has_pending_message_address() {
627 return reinterpret_cast<Address>(&thread_local_top_.has_pending_message_);
628 }
629
630 Object* scheduled_exception() { 624 Object* scheduled_exception() {
631 DCHECK(has_scheduled_exception()); 625 DCHECK(has_scheduled_exception());
632 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); 626 DCHECK(!thread_local_top_.scheduled_exception_->IsException());
633 return thread_local_top_.scheduled_exception_; 627 return thread_local_top_.scheduled_exception_;
634 } 628 }
635 bool has_scheduled_exception() { 629 bool has_scheduled_exception() {
636 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); 630 DCHECK(!thread_local_top_.scheduled_exception_->IsException());
637 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); 631 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value();
638 } 632 }
639 void clear_scheduled_exception() { 633 void clear_scheduled_exception() {
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 } 1571 }
1578 1572
1579 EmbeddedVector<char, 128> filename_; 1573 EmbeddedVector<char, 128> filename_;
1580 FILE* file_; 1574 FILE* file_;
1581 int scope_depth_; 1575 int scope_depth_;
1582 }; 1576 };
1583 1577
1584 } } // namespace v8::internal 1578 } } // namespace v8::internal
1585 1579
1586 #endif // V8_ISOLATE_H_ 1580 #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