| OLD | NEW |
| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // this table of handles to the actual constants. | 103 // this table of handles to the actual constants. |
| 104 // Static indirection table for handles to constants. If a Result | 104 // Static indirection table for handles to constants. If a Result |
| 105 // represents a constant, the data contains an index into this table | 105 // represents a constant, the data contains an index into this table |
| 106 // of handles to the actual constants. | 106 // of handles to the actual constants. |
| 107 typedef ZoneList<Handle<Object> > ZoneObjectList; | 107 typedef ZoneList<Handle<Object> > ZoneObjectList; |
| 108 | 108 |
| 109 #define RETURN_IF_SCHEDULED_EXCEPTION(isolate) \ | 109 #define RETURN_IF_SCHEDULED_EXCEPTION(isolate) \ |
| 110 if (isolate->has_scheduled_exception()) \ | 110 if (isolate->has_scheduled_exception()) \ |
| 111 return isolate->PromoteScheduledException() | 111 return isolate->PromoteScheduledException() |
| 112 | 112 |
| 113 #define RETURN_IF_EMPTY_HANDLE_VALUE(isolate, call, value) \ |
| 114 if (call.is_null()) { \ |
| 115 ASSERT(isolate->has_pending_exception()); \ |
| 116 return value; \ |
| 117 } |
| 118 |
| 119 #define RETURN_IF_EMPTY_HANDLE(isolate, call) \ |
| 120 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, call, Failure::Exception()) |
| 121 |
| 113 #define ISOLATE_ADDRESS_LIST(C) \ | 122 #define ISOLATE_ADDRESS_LIST(C) \ |
| 114 C(handler_address) \ | 123 C(handler_address) \ |
| 115 C(c_entry_fp_address) \ | 124 C(c_entry_fp_address) \ |
| 116 C(context_address) \ | 125 C(context_address) \ |
| 117 C(pending_exception_address) \ | 126 C(pending_exception_address) \ |
| 118 C(external_caught_exception_address) | 127 C(external_caught_exception_address) |
| 119 | 128 |
| 120 #ifdef ENABLE_LOGGING_AND_PROFILING | 129 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 121 #define ISOLATE_ADDRESS_LIST_PROF(C) \ | 130 #define ISOLATE_ADDRESS_LIST_PROF(C) \ |
| 122 C(js_entry_sp_address) | 131 C(js_entry_sp_address) |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 ASSERT(has_scheduled_exception()); | 517 ASSERT(has_scheduled_exception()); |
| 509 return thread_local_top_.scheduled_exception_; | 518 return thread_local_top_.scheduled_exception_; |
| 510 } | 519 } |
| 511 bool has_scheduled_exception() { | 520 bool has_scheduled_exception() { |
| 512 return !thread_local_top_.scheduled_exception_->IsTheHole(); | 521 return !thread_local_top_.scheduled_exception_->IsTheHole(); |
| 513 } | 522 } |
| 514 void clear_scheduled_exception() { | 523 void clear_scheduled_exception() { |
| 515 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); | 524 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); |
| 516 } | 525 } |
| 517 | 526 |
| 518 void setup_external_caught() { | 527 bool IsExternallyCaught(); |
| 519 thread_local_top_.external_caught_exception_ = | 528 |
| 520 has_pending_exception() && | 529 bool is_catchable_by_javascript(MaybeObject* exception) { |
| 521 (thread_local_top_.catcher_ != NULL) && | 530 return (exception != Failure::OutOfMemoryException()) && |
| 522 (try_catch_handler() == thread_local_top_.catcher_); | 531 (exception != heap()->termination_exception()); |
| 523 } | 532 } |
| 524 | 533 |
| 525 // JS execution stack (see frames.h). | 534 // JS execution stack (see frames.h). |
| 526 static Address c_entry_fp(ThreadLocalTop* thread) { | 535 static Address c_entry_fp(ThreadLocalTop* thread) { |
| 527 return thread->c_entry_fp_; | 536 return thread->c_entry_fp_; |
| 528 } | 537 } |
| 529 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } | 538 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } |
| 530 | 539 |
| 531 inline Address* c_entry_fp_address() { | 540 inline Address* c_entry_fp_address() { |
| 532 return &thread_local_top_.c_entry_fp_; | 541 return &thread_local_top_.c_entry_fp_; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 void ReportPendingMessages(); | 621 void ReportPendingMessages(); |
| 613 Failure* ThrowIllegalOperation(); | 622 Failure* ThrowIllegalOperation(); |
| 614 | 623 |
| 615 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. | 624 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. |
| 616 Failure* PromoteScheduledException(); | 625 Failure* PromoteScheduledException(); |
| 617 void DoThrow(MaybeObject* exception, | 626 void DoThrow(MaybeObject* exception, |
| 618 MessageLocation* location, | 627 MessageLocation* location, |
| 619 const char* message); | 628 const char* message); |
| 620 // Checks if exception should be reported and finds out if it's | 629 // Checks if exception should be reported and finds out if it's |
| 621 // caught externally. | 630 // caught externally. |
| 622 bool ShouldReportException(bool* is_caught_externally, | 631 bool ShouldReportException(bool* can_be_caught_externally, |
| 623 bool catchable_by_javascript); | 632 bool catchable_by_javascript); |
| 624 | 633 |
| 625 // Attempts to compute the current source location, storing the | 634 // Attempts to compute the current source location, storing the |
| 626 // result in the target out parameter. | 635 // result in the target out parameter. |
| 627 void ComputeLocation(MessageLocation* target); | 636 void ComputeLocation(MessageLocation* target); |
| 628 | 637 |
| 629 // Override command line flag. | 638 // Override command line flag. |
| 630 void TraceException(bool flag); | 639 void TraceException(bool flag); |
| 631 | 640 |
| 632 // Out of resource exception helpers. | 641 // Out of resource exception helpers. |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 | 1266 |
| 1258 } } // namespace v8::internal | 1267 } } // namespace v8::internal |
| 1259 | 1268 |
| 1260 // TODO(isolates): Get rid of these -inl.h includes and place them only where | 1269 // TODO(isolates): Get rid of these -inl.h includes and place them only where |
| 1261 // they're needed. | 1270 // they're needed. |
| 1262 #include "allocation-inl.h" | 1271 #include "allocation-inl.h" |
| 1263 #include "zone-inl.h" | 1272 #include "zone-inl.h" |
| 1264 #include "frames-inl.h" | 1273 #include "frames-inl.h" |
| 1265 | 1274 |
| 1266 #endif // V8_ISOLATE_H_ | 1275 #endif // V8_ISOLATE_H_ |
| OLD | NEW |