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 "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 7895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7906 isolate->RunMicrotasks(); | 7906 isolate->RunMicrotasks(); |
7907 } | 7907 } |
7908 } | 7908 } |
7909 | 7909 |
7910 | 7910 |
7911 int MicrotasksScope::GetCurrentDepth(Isolate* v8Isolate) { | 7911 int MicrotasksScope::GetCurrentDepth(Isolate* v8Isolate) { |
7912 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8Isolate); | 7912 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8Isolate); |
7913 return isolate->handle_scope_implementer()->GetMicrotasksScopeDepth(); | 7913 return isolate->handle_scope_implementer()->GetMicrotasksScopeDepth(); |
7914 } | 7914 } |
7915 | 7915 |
| 7916 bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8Isolate) { |
| 7917 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8Isolate); |
| 7918 return isolate->IsRunningMicrotasks(); |
| 7919 } |
7916 | 7920 |
7917 String::Utf8Value::Utf8Value(v8::Local<v8::Value> obj) | 7921 String::Utf8Value::Utf8Value(v8::Local<v8::Value> obj) |
7918 : str_(NULL), length_(0) { | 7922 : str_(NULL), length_(0) { |
7919 if (obj.IsEmpty()) return; | 7923 if (obj.IsEmpty()) return; |
7920 i::Isolate* isolate = i::Isolate::Current(); | 7924 i::Isolate* isolate = i::Isolate::Current(); |
7921 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); | 7925 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); |
7922 ENTER_V8(isolate); | 7926 ENTER_V8(isolate); |
7923 i::HandleScope scope(isolate); | 7927 i::HandleScope scope(isolate); |
7924 Local<Context> context = v8_isolate->GetCurrentContext(); | 7928 Local<Context> context = v8_isolate->GetCurrentContext(); |
7925 TryCatch try_catch(v8_isolate); | 7929 TryCatch try_catch(v8_isolate); |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8834 Address callback_address = | 8838 Address callback_address = |
8835 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8839 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8836 VMState<EXTERNAL> state(isolate); | 8840 VMState<EXTERNAL> state(isolate); |
8837 ExternalCallbackScope call_scope(isolate, callback_address); | 8841 ExternalCallbackScope call_scope(isolate, callback_address); |
8838 callback(info); | 8842 callback(info); |
8839 } | 8843 } |
8840 | 8844 |
8841 | 8845 |
8842 } // namespace internal | 8846 } // namespace internal |
8843 } // namespace v8 | 8847 } // namespace v8 |
OLD | NEW |