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

Side by Side Diff: src/execution.cc

Issue 11142013: Add methods to allow resuming execution after calling TerminateExecution(). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 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
OLDNEW
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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 set_interrupt_limits(access); 418 set_interrupt_limits(access);
419 } 419 }
420 420
421 421
422 bool StackGuard::IsTerminateExecution() { 422 bool StackGuard::IsTerminateExecution() {
423 ExecutionAccess access(isolate_); 423 ExecutionAccess access(isolate_);
424 return (thread_local_.interrupt_flags_ & TERMINATE) != 0; 424 return (thread_local_.interrupt_flags_ & TERMINATE) != 0;
425 } 425 }
426 426
427 427
428 void StackGuard::CancelTerminateExecution() {
429 ExecutionAccess access(isolate_);
430 Continue(TERMINATE);
431 isolate_->CancelTerminateExecution();
432 }
433
434
428 void StackGuard::TerminateExecution() { 435 void StackGuard::TerminateExecution() {
429 ExecutionAccess access(isolate_); 436 ExecutionAccess access(isolate_);
430 thread_local_.interrupt_flags_ |= TERMINATE; 437 thread_local_.interrupt_flags_ |= TERMINATE;
431 set_interrupt_limits(access); 438 set_interrupt_limits(access);
432 } 439 }
433 440
434 441
435 bool StackGuard::IsGCRequest() { 442 bool StackGuard::IsGCRequest() {
436 ExecutionAccess access(isolate_); 443 ExecutionAccess access(isolate_);
437 return (thread_local_.interrupt_flags_ & GC_REQUEST) != 0; 444 return (thread_local_.interrupt_flags_ & GC_REQUEST) != 0;
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 } 903 }
897 if (stack_guard->IsInterrupted()) { 904 if (stack_guard->IsInterrupted()) {
898 stack_guard->Continue(INTERRUPT); 905 stack_guard->Continue(INTERRUPT);
899 return isolate->StackOverflow(); 906 return isolate->StackOverflow();
900 } 907 }
901 return isolate->heap()->undefined_value(); 908 return isolate->heap()->undefined_value();
902 } 909 }
903 910
904 911
905 } } // namespace v8::internal 912 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.h ('k') | src/isolate.h » ('j') | test/cctest/test-thread-termination.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698