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/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3250 v8::MicrotaskCallback callback = | 3250 v8::MicrotaskCallback callback = |
3251 v8::ToCData<v8::MicrotaskCallback>(callback_info->callback()); | 3251 v8::ToCData<v8::MicrotaskCallback>(callback_info->callback()); |
3252 void* data = v8::ToCData<void*>(callback_info->data()); | 3252 void* data = v8::ToCData<void*>(callback_info->data()); |
3253 callback(data); | 3253 callback(data); |
3254 } else { | 3254 } else { |
3255 SaveContext save(this); | 3255 SaveContext save(this); |
3256 Context* context; | 3256 Context* context; |
3257 if (microtask->IsJSFunction()) { | 3257 if (microtask->IsJSFunction()) { |
3258 context = Handle<JSFunction>::cast(microtask)->context(); | 3258 context = Handle<JSFunction>::cast(microtask)->context(); |
3259 } else if (microtask->IsPromiseResolveThenableJobInfo()) { | 3259 } else if (microtask->IsPromiseResolveThenableJobInfo()) { |
3260 context = Handle<PromiseResolveThenableJobInfo>::cast(microtask) | 3260 context = |
3261 ->resolve() | 3261 Handle<PromiseResolveThenableJobInfo>::cast(microtask)->context(); |
3262 ->context(); | |
3263 } else { | 3262 } else { |
3264 context = Handle<PromiseReactionJobInfo>::cast(microtask)->context(); | 3263 context = Handle<PromiseReactionJobInfo>::cast(microtask)->context(); |
3265 } | 3264 } |
3266 | 3265 |
3267 set_context(context->native_context()); | 3266 set_context(context->native_context()); |
3268 handle_scope_implementer_->EnterMicrotaskContext( | 3267 handle_scope_implementer_->EnterMicrotaskContext( |
3269 Handle<Context>(context, this)); | 3268 Handle<Context>(context, this)); |
3270 | 3269 |
3271 MaybeHandle<Object> result; | 3270 MaybeHandle<Object> result; |
3272 MaybeHandle<Object> maybe_exception; | 3271 MaybeHandle<Object> maybe_exception; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3489 // Then check whether this scope intercepts. | 3488 // Then check whether this scope intercepts. |
3490 if ((flag & intercept_mask_)) { | 3489 if ((flag & intercept_mask_)) { |
3491 intercepted_flags_ |= flag; | 3490 intercepted_flags_ |= flag; |
3492 return true; | 3491 return true; |
3493 } | 3492 } |
3494 return false; | 3493 return false; |
3495 } | 3494 } |
3496 | 3495 |
3497 } // namespace internal | 3496 } // namespace internal |
3498 } // namespace v8 | 3497 } // namespace v8 |
OLD | NEW |