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

Side by Side Diff: src/api.cc

Issue 668052: Add IsExecutionTerminating api method.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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 | « include/v8.h ('k') | test/cctest/test-thread-termination.cc » ('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 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 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after
3608 } 3608 }
3609 } 3609 }
3610 3610
3611 3611
3612 void V8::TerminateExecution() { 3612 void V8::TerminateExecution() {
3613 if (!i::V8::IsRunning()) return; 3613 if (!i::V8::IsRunning()) return;
3614 i::StackGuard::TerminateExecution(); 3614 i::StackGuard::TerminateExecution();
3615 } 3615 }
3616 3616
3617 3617
3618 bool V8::IsExecutionTerminating() {
3619 if (!i::V8::IsRunning()) return false;
3620 if (i::Top::has_scheduled_exception()) {
3621 return i::Top::scheduled_exception() == i::Heap::termination_exception();
3622 }
3623 return false;
3624 }
3625
3626
3618 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) { 3627 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) {
3619 EnsureInitialized("v8::String::Utf8Value::Utf8Value()"); 3628 EnsureInitialized("v8::String::Utf8Value::Utf8Value()");
3620 if (obj.IsEmpty()) { 3629 if (obj.IsEmpty()) {
3621 str_ = NULL; 3630 str_ = NULL;
3622 length_ = 0; 3631 length_ = 0;
3623 return; 3632 return;
3624 } 3633 }
3625 ENTER_V8; 3634 ENTER_V8;
3626 HandleScope scope; 3635 HandleScope scope;
3627 TryCatch try_catch; 3636 TryCatch try_catch;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
3992 4001
3993 4002
3994 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 4003 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3995 HandleScopeImplementer* thread_local = 4004 HandleScopeImplementer* thread_local =
3996 reinterpret_cast<HandleScopeImplementer*>(storage); 4005 reinterpret_cast<HandleScopeImplementer*>(storage);
3997 thread_local->IterateThis(v); 4006 thread_local->IterateThis(v);
3998 return storage + ArchiveSpacePerThread(); 4007 return storage + ArchiveSpacePerThread();
3999 } 4008 }
4000 4009
4001 } } // namespace v8::internal 4010 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-thread-termination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698