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

Side by Side Diff: src/api.cc

Issue 102063004: Introduce API to temporarily interrupt long running JavaScript code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 6704 matching lines...) Expand 10 before | Expand all | Expand 10 after
6715 return IsExecutionTerminatingCheck(i_isolate); 6715 return IsExecutionTerminatingCheck(i_isolate);
6716 } 6716 }
6717 6717
6718 6718
6719 void V8::CancelTerminateExecution(Isolate* isolate) { 6719 void V8::CancelTerminateExecution(Isolate* isolate) {
6720 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); 6720 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
6721 i_isolate->stack_guard()->CancelTerminateExecution(); 6721 i_isolate->stack_guard()->CancelTerminateExecution();
6722 } 6722 }
6723 6723
6724 6724
6725 void Isolate::RequestInterrupt(InterruptCallback callback, void* data) {
6726 reinterpret_cast<i::Isolate*>(this)->stack_guard()->RequestInterrupt(
6727 callback, data);
6728 }
6729
6730
6731 void Isolate::ClearInterrupt() {
6732 reinterpret_cast<i::Isolate*>(this)->stack_guard()->ClearInterrupt();
6733 }
6734
6735
6725 Isolate* Isolate::GetCurrent() { 6736 Isolate* Isolate::GetCurrent() {
6726 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 6737 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
6727 return reinterpret_cast<Isolate*>(isolate); 6738 return reinterpret_cast<Isolate*>(isolate);
6728 } 6739 }
6729 6740
6730 6741
6731 Isolate* Isolate::New() { 6742 Isolate* Isolate::New() {
6732 i::Isolate* isolate = new i::Isolate(); 6743 i::Isolate* isolate = new i::Isolate();
6733 return reinterpret_cast<Isolate*>(isolate); 6744 return reinterpret_cast<Isolate*>(isolate);
6734 } 6745 }
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
7780 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7791 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7781 Address callback_address = 7792 Address callback_address =
7782 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7793 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7783 VMState<EXTERNAL> state(isolate); 7794 VMState<EXTERNAL> state(isolate);
7784 ExternalCallbackScope call_scope(isolate, callback_address); 7795 ExternalCallbackScope call_scope(isolate, callback_address);
7785 callback(info); 7796 callback(info);
7786 } 7797 }
7787 7798
7788 7799
7789 } } // namespace v8::internal 7800 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/execution.h » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698