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 3281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3292 | 3292 |
3293 bool Value::IsRegExp() const { | 3293 bool Value::IsRegExp() const { |
3294 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 3294 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
3295 return obj->IsJSRegExp(); | 3295 return obj->IsJSRegExp(); |
3296 } | 3296 } |
3297 | 3297 |
3298 bool Value::IsAsyncFunction() const { | 3298 bool Value::IsAsyncFunction() const { |
3299 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 3299 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
3300 if (!obj->IsJSFunction()) return false; | 3300 if (!obj->IsJSFunction()) return false; |
3301 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast(obj); | 3301 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast(obj); |
3302 return func->shared()->is_async(); | 3302 return i::IsAsyncFunction(func->shared()->kind()); |
3303 } | 3303 } |
3304 | 3304 |
3305 bool Value::IsGeneratorFunction() const { | 3305 bool Value::IsGeneratorFunction() const { |
3306 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 3306 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
3307 if (!obj->IsJSFunction()) return false; | 3307 if (!obj->IsJSFunction()) return false; |
3308 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast(obj); | 3308 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast(obj); |
3309 return func->shared()->is_generator(); | 3309 return i::IsGeneratorFunction(func->shared()->kind()); |
3310 } | 3310 } |
3311 | 3311 |
3312 | 3312 |
3313 bool Value::IsGeneratorObject() const { | 3313 bool Value::IsGeneratorObject() const { |
3314 return Utils::OpenHandle(this)->IsJSGeneratorObject(); | 3314 return Utils::OpenHandle(this)->IsJSGeneratorObject(); |
3315 } | 3315 } |
3316 | 3316 |
3317 | 3317 |
3318 bool Value::IsMapIterator() const { | 3318 bool Value::IsMapIterator() const { |
3319 return Utils::OpenHandle(this)->IsJSMapIterator(); | 3319 return Utils::OpenHandle(this)->IsJSMapIterator(); |
(...skipping 6049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9369 Address callback_address = | 9369 Address callback_address = |
9370 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9370 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9371 VMState<EXTERNAL> state(isolate); | 9371 VMState<EXTERNAL> state(isolate); |
9372 ExternalCallbackScope call_scope(isolate, callback_address); | 9372 ExternalCallbackScope call_scope(isolate, callback_address); |
9373 callback(info); | 9373 callback(info); |
9374 } | 9374 } |
9375 | 9375 |
9376 | 9376 |
9377 } // namespace internal | 9377 } // namespace internal |
9378 } // namespace v8 | 9378 } // namespace v8 |
OLD | NEW |