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

Side by Side Diff: src/api.cc

Issue 2091243002: Use the instance type to determine if an object is a promise. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@SimplifyIsError
Patch Set: Rebase Created 4 years, 5 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
« no previous file with comments | « no previous file | src/objects.h » ('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 // 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 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 3030
3031 bool Value::IsMapIterator() const { 3031 bool Value::IsMapIterator() const {
3032 return Utils::OpenHandle(this)->IsJSMapIterator(); 3032 return Utils::OpenHandle(this)->IsJSMapIterator();
3033 } 3033 }
3034 3034
3035 3035
3036 bool Value::IsSetIterator() const { 3036 bool Value::IsSetIterator() const {
3037 return Utils::OpenHandle(this)->IsJSSetIterator(); 3037 return Utils::OpenHandle(this)->IsJSSetIterator();
3038 } 3038 }
3039 3039
3040 3040 bool Value::IsPromise() const { return Utils::OpenHandle(this)->IsJSPromise(); }
3041 bool Value::IsPromise() const {
3042 auto self = Utils::OpenHandle(this);
3043 return i::Object::IsPromise(self);
3044 }
3045
3046 3041
3047 MaybeLocal<String> Value::ToString(Local<Context> context) const { 3042 MaybeLocal<String> Value::ToString(Local<Context> context) const {
3048 auto obj = Utils::OpenHandle(this); 3043 auto obj = Utils::OpenHandle(this);
3049 if (obj->IsString()) return ToApiHandle<String>(obj); 3044 if (obj->IsString()) return ToApiHandle<String>(obj);
3050 PREPARE_FOR_EXECUTION(context, Object, ToString, String); 3045 PREPARE_FOR_EXECUTION(context, Object, ToString, String);
3051 Local<String> result; 3046 Local<String> result;
3052 has_pending_exception = 3047 has_pending_exception =
3053 !ToLocal<String>(i::Object::ToString(isolate, obj), &result); 3048 !ToLocal<String>(i::Object::ToString(isolate, obj), &result);
3054 RETURN_ON_FAILED_EXECUTION(String); 3049 RETURN_ON_FAILED_EXECUTION(String);
3055 RETURN_ESCAPED(result); 3050 RETURN_ESCAPED(result);
(...skipping 5814 matching lines...) Expand 10 before | Expand all | Expand 10 after
8870 Address callback_address = 8865 Address callback_address =
8871 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8866 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8872 VMState<EXTERNAL> state(isolate); 8867 VMState<EXTERNAL> state(isolate);
8873 ExternalCallbackScope call_scope(isolate, callback_address); 8868 ExternalCallbackScope call_scope(isolate, callback_address);
8874 callback(info); 8869 callback(info);
8875 } 8870 }
8876 8871
8877 8872
8878 } // namespace internal 8873 } // namespace internal
8879 } // namespace v8 8874 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698