OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 3541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3552 } | 3552 } |
3553 } | 3553 } |
3554 | 3554 |
3555 | 3555 |
3556 void V8::TerminateExecution() { | 3556 void V8::TerminateExecution() { |
3557 if (!i::V8::IsRunning()) return; | 3557 if (!i::V8::IsRunning()) return; |
3558 i::StackGuard::TerminateExecution(); | 3558 i::StackGuard::TerminateExecution(); |
3559 } | 3559 } |
3560 | 3560 |
3561 | 3561 |
| 3562 bool V8::IsExecutionTerminating() { |
| 3563 if (!i::V8::IsRunning()) return false; |
| 3564 if (i::Top::has_scheduled_exception()) { |
| 3565 return i::Top::scheduled_exception() == i::Heap::termination_exception(); |
| 3566 } |
| 3567 return false; |
| 3568 } |
| 3569 |
| 3570 |
3562 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) { | 3571 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) { |
3563 EnsureInitialized("v8::String::Utf8Value::Utf8Value()"); | 3572 EnsureInitialized("v8::String::Utf8Value::Utf8Value()"); |
3564 if (obj.IsEmpty()) { | 3573 if (obj.IsEmpty()) { |
3565 str_ = NULL; | 3574 str_ = NULL; |
3566 length_ = 0; | 3575 length_ = 0; |
3567 return; | 3576 return; |
3568 } | 3577 } |
3569 ENTER_V8; | 3578 ENTER_V8; |
3570 HandleScope scope; | 3579 HandleScope scope; |
3571 TryCatch try_catch; | 3580 TryCatch try_catch; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3936 | 3945 |
3937 | 3946 |
3938 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 3947 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
3939 HandleScopeImplementer* thread_local = | 3948 HandleScopeImplementer* thread_local = |
3940 reinterpret_cast<HandleScopeImplementer*>(storage); | 3949 reinterpret_cast<HandleScopeImplementer*>(storage); |
3941 thread_local->IterateThis(v); | 3950 thread_local->IterateThis(v); |
3942 return storage + ArchiveSpacePerThread(); | 3951 return storage + ArchiveSpacePerThread(); |
3943 } | 3952 } |
3944 | 3953 |
3945 } } // namespace v8::internal | 3954 } } // namespace v8::internal |
OLD | NEW |