| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_INL_H_ | 5 #ifndef V8_ISOLATE_INL_H_ |
| 6 #define V8_ISOLATE_INL_H_ | 6 #define V8_ISOLATE_INL_H_ |
| 7 | 7 |
| 8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 | 14 |
| 15 void Isolate::set_context(Context* context) { | 15 void Isolate::set_context(Context* context) { |
| 16 DCHECK(context == NULL || context->IsContext()); | 16 DCHECK(context == NULL || context->IsContext()); |
| 17 thread_local_top_.context_ = context; | 17 thread_local_top_.context_ = context; |
| 18 } | 18 } |
| 19 | 19 |
| 20 | 20 |
| 21 Object* Isolate::pending_exception() { | 21 Object* Isolate::pending_exception() { |
| 22 DCHECK(has_pending_exception()); | 22 DCHECK(has_pending_exception()); |
| 23 DCHECK(!thread_local_top_.pending_exception_->IsException(this)); | 23 DCHECK(!thread_local_top_.pending_exception_->IsException()); |
| 24 return thread_local_top_.pending_exception_; | 24 return thread_local_top_.pending_exception_; |
| 25 } | 25 } |
| 26 | 26 |
| 27 | 27 |
| 28 void Isolate::set_pending_exception(Object* exception_obj) { | 28 void Isolate::set_pending_exception(Object* exception_obj) { |
| 29 DCHECK(!exception_obj->IsException(this)); | 29 DCHECK(!exception_obj->IsException()); |
| 30 thread_local_top_.pending_exception_ = exception_obj; | 30 thread_local_top_.pending_exception_ = exception_obj; |
| 31 } | 31 } |
| 32 | 32 |
| 33 | 33 |
| 34 void Isolate::clear_pending_exception() { | 34 void Isolate::clear_pending_exception() { |
| 35 DCHECK(!thread_local_top_.pending_exception_->IsException(this)); | 35 DCHECK(!thread_local_top_.pending_exception_->IsException()); |
| 36 thread_local_top_.pending_exception_ = heap_.the_hole_value(); | 36 thread_local_top_.pending_exception_ = heap_.the_hole_value(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 | 39 |
| 40 bool Isolate::has_pending_exception() { | 40 bool Isolate::has_pending_exception() { |
| 41 DCHECK(!thread_local_top_.pending_exception_->IsException(this)); | 41 DCHECK(!thread_local_top_.pending_exception_->IsException()); |
| 42 return !thread_local_top_.pending_exception_->IsTheHole(this); | 42 return !thread_local_top_.pending_exception_->IsTheHole(this); |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 void Isolate::clear_pending_message() { | 46 void Isolate::clear_pending_message() { |
| 47 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); | 47 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 | 50 |
| 51 Object* Isolate::scheduled_exception() { | 51 Object* Isolate::scheduled_exception() { |
| 52 DCHECK(has_scheduled_exception()); | 52 DCHECK(has_scheduled_exception()); |
| 53 DCHECK(!thread_local_top_.scheduled_exception_->IsException(this)); | 53 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); |
| 54 return thread_local_top_.scheduled_exception_; | 54 return thread_local_top_.scheduled_exception_; |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 bool Isolate::has_scheduled_exception() { | 58 bool Isolate::has_scheduled_exception() { |
| 59 DCHECK(!thread_local_top_.scheduled_exception_->IsException(this)); | 59 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); |
| 60 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); | 60 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 | 63 |
| 64 void Isolate::clear_scheduled_exception() { | 64 void Isolate::clear_scheduled_exception() { |
| 65 DCHECK(!thread_local_top_.scheduled_exception_->IsException(this)); | 65 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); |
| 66 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); | 66 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 bool Isolate::is_catchable_by_javascript(Object* exception) { | 70 bool Isolate::is_catchable_by_javascript(Object* exception) { |
| 71 return exception != heap()->termination_exception(); | 71 return exception != heap()->termination_exception(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 | 74 |
| 75 Handle<JSGlobalObject> Isolate::global_object() { | 75 Handle<JSGlobalObject> Isolate::global_object() { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bool Isolate::IsHasInstanceLookupChainIntact() { | 123 bool Isolate::IsHasInstanceLookupChainIntact() { |
| 124 if (!FLAG_harmony_instanceof) return true; | 124 if (!FLAG_harmony_instanceof) return true; |
| 125 PropertyCell* has_instance_cell = heap()->has_instance_protector(); | 125 PropertyCell* has_instance_cell = heap()->has_instance_protector(); |
| 126 return has_instance_cell->value() == Smi::FromInt(kArrayProtectorValid); | 126 return has_instance_cell->value() == Smi::FromInt(kArrayProtectorValid); |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace internal | 129 } // namespace internal |
| 130 } // namespace v8 | 130 } // namespace v8 |
| 131 | 131 |
| 132 #endif // V8_ISOLATE_INL_H_ | 132 #endif // V8_ISOLATE_INL_H_ |
| OLD | NEW |