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

Side by Side Diff: src/isolate.h

Issue 6816021: Report stack overflow exceptions to V8 message listeners (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/messages.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 ASSERT(!external_caught_exception_); 172 ASSERT(!external_caught_exception_);
173 ASSERT(try_catch_handler_address_ == NULL); 173 ASSERT(try_catch_handler_address_ == NULL);
174 } 174 }
175 175
176 // The context where the current execution method is created and for variable 176 // The context where the current execution method is created and for variable
177 // lookups. 177 // lookups.
178 Context* context_; 178 Context* context_;
179 int thread_id_; 179 int thread_id_;
180 MaybeObject* pending_exception_; 180 MaybeObject* pending_exception_;
181 bool has_pending_message_; 181 bool has_pending_message_;
182 const char* pending_message_;
183 Object* pending_message_obj_; 182 Object* pending_message_obj_;
184 Script* pending_message_script_; 183 Script* pending_message_script_;
185 int pending_message_start_pos_; 184 int pending_message_start_pos_;
186 int pending_message_end_pos_; 185 int pending_message_end_pos_;
187 // Use a separate value for scheduled exceptions to preserve the 186 // Use a separate value for scheduled exceptions to preserve the
188 // invariants that hold about pending_exception. We may want to 187 // invariants that hold about pending_exception. We may want to
189 // unify them later. 188 // unify them later.
190 MaybeObject* scheduled_exception_; 189 MaybeObject* scheduled_exception_;
191 bool external_caught_exception_; 190 bool external_caught_exception_;
192 // True if unhandled message is being currently reported by 191 // True if unhandled message is being currently reported by
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 thread_local_top_.pending_exception_ = heap_.the_hole_value(); 507 thread_local_top_.pending_exception_ = heap_.the_hole_value();
509 } 508 }
510 MaybeObject** pending_exception_address() { 509 MaybeObject** pending_exception_address() {
511 return &thread_local_top_.pending_exception_; 510 return &thread_local_top_.pending_exception_;
512 } 511 }
513 bool has_pending_exception() { 512 bool has_pending_exception() {
514 return !thread_local_top_.pending_exception_->IsTheHole(); 513 return !thread_local_top_.pending_exception_->IsTheHole();
515 } 514 }
516 void clear_pending_message() { 515 void clear_pending_message() {
517 thread_local_top_.has_pending_message_ = false; 516 thread_local_top_.has_pending_message_ = false;
518 thread_local_top_.pending_message_ = NULL;
519 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); 517 thread_local_top_.pending_message_obj_ = heap_.the_hole_value();
520 thread_local_top_.pending_message_script_ = NULL; 518 thread_local_top_.pending_message_script_ = NULL;
521 } 519 }
522 v8::TryCatch* try_catch_handler() { 520 v8::TryCatch* try_catch_handler() {
523 return thread_local_top_.TryCatchHandler(); 521 return thread_local_top_.TryCatchHandler();
524 } 522 }
525 Address try_catch_handler_address() { 523 Address try_catch_handler_address() {
526 return thread_local_top_.try_catch_handler_address(); 524 return thread_local_top_.try_catch_handler_address();
527 } 525 }
528 bool* external_caught_exception_address() { 526 bool* external_caught_exception_address() {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 // Re-throw an exception. This involves no error reporting since 666 // Re-throw an exception. This involves no error reporting since
669 // error reporting was handled when the exception was thrown 667 // error reporting was handled when the exception was thrown
670 // originally. 668 // originally.
671 Failure* ReThrow(MaybeObject* exception, MessageLocation* location = NULL); 669 Failure* ReThrow(MaybeObject* exception, MessageLocation* location = NULL);
672 void ScheduleThrow(Object* exception); 670 void ScheduleThrow(Object* exception);
673 void ReportPendingMessages(); 671 void ReportPendingMessages();
674 Failure* ThrowIllegalOperation(); 672 Failure* ThrowIllegalOperation();
675 673
676 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. 674 // Promote a scheduled exception to pending. Asserts has_scheduled_exception.
677 Failure* PromoteScheduledException(); 675 Failure* PromoteScheduledException();
678 void DoThrow(MaybeObject* exception, 676 void DoThrow(MaybeObject* exception, MessageLocation* location);
679 MessageLocation* location,
680 const char* message);
681 // Checks if exception should be reported and finds out if it's 677 // Checks if exception should be reported and finds out if it's
682 // caught externally. 678 // caught externally.
683 bool ShouldReportException(bool* can_be_caught_externally, 679 bool ShouldReportException(bool* can_be_caught_externally,
684 bool catchable_by_javascript); 680 bool catchable_by_javascript);
685 681
686 // Attempts to compute the current source location, storing the 682 // Attempts to compute the current source location, storing the
687 // result in the target out parameter. 683 // result in the target out parameter.
688 void ComputeLocation(MessageLocation* target); 684 void ComputeLocation(MessageLocation* target);
689 685
690 // Override command line flag. 686 // Override command line flag.
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 1340
1345 } } // namespace v8::internal 1341 } } // namespace v8::internal
1346 1342
1347 // TODO(isolates): Get rid of these -inl.h includes and place them only where 1343 // TODO(isolates): Get rid of these -inl.h includes and place them only where
1348 // they're needed. 1344 // they're needed.
1349 #include "allocation-inl.h" 1345 #include "allocation-inl.h"
1350 #include "zone-inl.h" 1346 #include "zone-inl.h"
1351 #include "frames-inl.h" 1347 #include "frames-inl.h"
1352 1348
1353 #endif // V8_ISOLATE_H_ 1349 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « no previous file | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698