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

Side by Side Diff: src/api.cc

Issue 154283002: V8 Microtask Queue & API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: heapconst Created 6 years, 10 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') | src/bootstrapper.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 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 6275 matching lines...) Expand 10 before | Expand all | Expand 10 after
6286 callback); 6286 callback);
6287 } 6287 }
6288 6288
6289 6289
6290 void V8::AddCallCompletedCallback(CallCompletedCallback callback) { 6290 void V8::AddCallCompletedCallback(CallCompletedCallback callback) {
6291 if (callback == NULL) return; 6291 if (callback == NULL) return;
6292 i::V8::AddCallCompletedCallback(callback); 6292 i::V8::AddCallCompletedCallback(callback);
6293 } 6293 }
6294 6294
6295 6295
6296 void V8::RunMicrotasks(Isolate* isolate) {
6297 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
6298 i::HandleScope scope(i_isolate);
6299 i::V8::RunMicrotasks(i_isolate);
6300 }
6301
6302
6303 void V8::EnqueueMicrotask(Isolate* isolate, Handle<Function> microtask) {
6304 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
6305 ENTER_V8(i_isolate);
6306 i::Execution::EnqueueMicrotask(i_isolate, Utils::OpenHandle(*microtask));
6307 }
6308
6309
6310 void V8::SetAutorunMicrotasks(Isolate* isolate, bool autorun) {
6311 reinterpret_cast<i::Isolate*>(isolate)->set_autorun_microtasks(autorun);
6312 }
6313
6314
6296 void V8::RemoveCallCompletedCallback(CallCompletedCallback callback) { 6315 void V8::RemoveCallCompletedCallback(CallCompletedCallback callback) {
6297 i::V8::RemoveCallCompletedCallback(callback); 6316 i::V8::RemoveCallCompletedCallback(callback);
6298 } 6317 }
6299 6318
6300 6319
6301 void V8::TerminateExecution(Isolate* isolate) { 6320 void V8::TerminateExecution(Isolate* isolate) {
6302 // If no isolate is supplied, use the default isolate. 6321 // If no isolate is supplied, use the default isolate.
6303 if (isolate != NULL) { 6322 if (isolate != NULL) {
6304 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution(); 6323 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution();
6305 } else { 6324 } else {
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
7351 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7370 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7352 Address callback_address = 7371 Address callback_address =
7353 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7372 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7354 VMState<EXTERNAL> state(isolate); 7373 VMState<EXTERNAL> state(isolate);
7355 ExternalCallbackScope call_scope(isolate, callback_address); 7374 ExternalCallbackScope call_scope(isolate, callback_address);
7356 callback(info); 7375 callback(info);
7357 } 7376 }
7358 7377
7359 7378
7360 } } // namespace v8::internal 7379 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698