OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "api.h" | 5 #include "api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #include <cmath> // For isnan. | 8 #include <cmath> // For isnan. |
9 #include "../include/v8-debug.h" | 9 #include "../include/v8-debug.h" |
10 #include "../include/v8-profiler.h" | 10 #include "../include/v8-profiler.h" |
(...skipping 6436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6447 } | 6447 } |
6448 | 6448 |
6449 | 6449 |
6450 void V8::RemoveMemoryAllocationCallback(MemoryAllocationCallback callback) { | 6450 void V8::RemoveMemoryAllocationCallback(MemoryAllocationCallback callback) { |
6451 i::Isolate* isolate = i::Isolate::Current(); | 6451 i::Isolate* isolate = i::Isolate::Current(); |
6452 isolate->memory_allocator()->RemoveMemoryAllocationCallback( | 6452 isolate->memory_allocator()->RemoveMemoryAllocationCallback( |
6453 callback); | 6453 callback); |
6454 } | 6454 } |
6455 | 6455 |
6456 | 6456 |
6457 void V8::RunMicrotasks(Isolate* isolate) { | |
6458 isolate->RunMicrotasks(); | |
6459 } | |
6460 | |
6461 | |
6462 void V8::EnqueueMicrotask(Isolate* isolate, Handle<Function> microtask) { | |
6463 isolate->EnqueueMicrotask(microtask); | |
6464 } | |
6465 | |
6466 | |
6467 void V8::SetAutorunMicrotasks(Isolate* isolate, bool autorun) { | |
6468 isolate->SetAutorunMicrotasks(autorun); | |
6469 } | |
6470 | |
6471 | |
6472 void V8::TerminateExecution(Isolate* isolate) { | 6457 void V8::TerminateExecution(Isolate* isolate) { |
6473 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution(); | 6458 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution(); |
6474 } | 6459 } |
6475 | 6460 |
6476 | 6461 |
6477 bool V8::IsExecutionTerminating(Isolate* isolate) { | 6462 bool V8::IsExecutionTerminating(Isolate* isolate) { |
6478 i::Isolate* i_isolate = isolate != NULL ? | 6463 i::Isolate* i_isolate = isolate != NULL ? |
6479 reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current(); | 6464 reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current(); |
6480 return IsExecutionTerminatingCheck(i_isolate); | 6465 return IsExecutionTerminatingCheck(i_isolate); |
6481 } | 6466 } |
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7594 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7579 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7595 Address callback_address = | 7580 Address callback_address = |
7596 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7581 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7597 VMState<EXTERNAL> state(isolate); | 7582 VMState<EXTERNAL> state(isolate); |
7598 ExternalCallbackScope call_scope(isolate, callback_address); | 7583 ExternalCallbackScope call_scope(isolate, callback_address); |
7599 callback(info); | 7584 callback(info); |
7600 } | 7585 } |
7601 | 7586 |
7602 | 7587 |
7603 } } // namespace v8::internal | 7588 } } // namespace v8::internal |
OLD | NEW |