OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 // handler the exception is scheduled to be rethrown when we return to running | 666 // handler the exception is scheduled to be rethrown when we return to running |
667 // JavaScript code. If an exception is scheduled true is returned. | 667 // JavaScript code. If an exception is scheduled true is returned. |
668 bool OptionalRescheduleException(bool is_bottom_call); | 668 bool OptionalRescheduleException(bool is_bottom_call); |
669 | 669 |
670 class ExceptionScope { | 670 class ExceptionScope { |
671 public: | 671 public: |
672 explicit ExceptionScope(Isolate* isolate) : | 672 explicit ExceptionScope(Isolate* isolate) : |
673 // Scope currently can only be used for regular exceptions, not | 673 // Scope currently can only be used for regular exceptions, not |
674 // failures like OOM or termination exception. | 674 // failures like OOM or termination exception. |
675 isolate_(isolate), | 675 isolate_(isolate), |
676 pending_exception_(isolate_->pending_exception()->ToObjectUnchecked()), | 676 pending_exception_(isolate_->pending_exception()->ToObjectUnchecked(), |
| 677 isolate_), |
677 catcher_(isolate_->catcher()) | 678 catcher_(isolate_->catcher()) |
678 { } | 679 { } |
679 | 680 |
680 ~ExceptionScope() { | 681 ~ExceptionScope() { |
681 isolate_->set_catcher(catcher_); | 682 isolate_->set_catcher(catcher_); |
682 isolate_->set_pending_exception(*pending_exception_); | 683 isolate_->set_pending_exception(*pending_exception_); |
683 } | 684 } |
684 | 685 |
685 private: | 686 private: |
686 Isolate* isolate_; | 687 Isolate* isolate_; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 #undef GLOBAL_ACCESSOR | 807 #undef GLOBAL_ACCESSOR |
807 | 808 |
808 #define GLOBAL_ARRAY_ACCESSOR(type, name, length) \ | 809 #define GLOBAL_ARRAY_ACCESSOR(type, name, length) \ |
809 inline type* name() { \ | 810 inline type* name() { \ |
810 ASSERT(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ | 811 ASSERT(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ |
811 return &(name##_)[0]; \ | 812 return &(name##_)[0]; \ |
812 } | 813 } |
813 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR) | 814 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR) |
814 #undef GLOBAL_ARRAY_ACCESSOR | 815 #undef GLOBAL_ARRAY_ACCESSOR |
815 | 816 |
816 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ | 817 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ |
817 Handle<type> name() { \ | 818 Handle<type> name() { \ |
818 return Handle<type>(context()->native_context()->name()); \ | 819 return Handle<type>(context()->native_context()->name(), this); \ |
819 } | 820 } |
820 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) | 821 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) |
821 #undef NATIVE_CONTEXT_FIELD_ACCESSOR | 822 #undef NATIVE_CONTEXT_FIELD_ACCESSOR |
822 | 823 |
823 Bootstrapper* bootstrapper() { return bootstrapper_; } | 824 Bootstrapper* bootstrapper() { return bootstrapper_; } |
824 Counters* counters() { | 825 Counters* counters() { |
825 // Call InitializeLoggingAndCounters() if logging is needed before | 826 // Call InitializeLoggingAndCounters() if logging is needed before |
826 // the isolate is fully initialized. | 827 // the isolate is fully initialized. |
827 ASSERT(counters_ != NULL); | 828 ASSERT(counters_ != NULL); |
828 return counters_; | 829 return counters_; |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 | 1462 |
1462 // Mark the native context with out of memory. | 1463 // Mark the native context with out of memory. |
1463 inline void Context::mark_out_of_memory() { | 1464 inline void Context::mark_out_of_memory() { |
1464 native_context()->set_out_of_memory(HEAP->true_value()); | 1465 native_context()->set_out_of_memory(HEAP->true_value()); |
1465 } | 1466 } |
1466 | 1467 |
1467 | 1468 |
1468 } } // namespace v8::internal | 1469 } } // namespace v8::internal |
1469 | 1470 |
1470 #endif // V8_ISOLATE_H_ | 1471 #endif // V8_ISOLATE_H_ |
OLD | NEW |