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

Side by Side Diff: src/api.cc

Issue 1589323002: [runtime] Unify the ToObject handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/builtins.cc » ('j') | src/builtins.cc » ('J')
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 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 2924
2925 2925
2926 Local<String> Value::ToDetailString(Isolate* isolate) const { 2926 Local<String> Value::ToDetailString(Isolate* isolate) const {
2927 RETURN_TO_LOCAL_UNCHECKED(ToDetailString(isolate->GetCurrentContext()), 2927 RETURN_TO_LOCAL_UNCHECKED(ToDetailString(isolate->GetCurrentContext()),
2928 String); 2928 String);
2929 } 2929 }
2930 2930
2931 2931
2932 MaybeLocal<Object> Value::ToObject(Local<Context> context) const { 2932 MaybeLocal<Object> Value::ToObject(Local<Context> context) const {
2933 auto obj = Utils::OpenHandle(this); 2933 auto obj = Utils::OpenHandle(this);
2934 if (obj->IsJSObject()) return ToApiHandle<Object>(obj); 2934 if (obj->IsJSReceiver()) return ToApiHandle<Object>(obj);
2935 PREPARE_FOR_EXECUTION(context, "ToObject", Object); 2935 PREPARE_FOR_EXECUTION(context, "ToObject", Object);
2936 Local<Object> result; 2936 Local<Object> result;
2937 has_pending_exception = 2937 has_pending_exception =
2938 !ToLocal<Object>(i::Execution::ToObject(isolate, obj), &result); 2938 !ToLocal<Object>(i::Object::ToObject(isolate, obj), &result);
2939 RETURN_ON_FAILED_EXECUTION(Object); 2939 RETURN_ON_FAILED_EXECUTION(Object);
2940 RETURN_ESCAPED(result); 2940 RETURN_ESCAPED(result);
2941 } 2941 }
2942 2942
2943 2943
2944 Local<v8::Object> Value::ToObject(Isolate* isolate) const { 2944 Local<v8::Object> Value::ToObject(Isolate* isolate) const {
2945 RETURN_TO_LOCAL_UNCHECKED(ToObject(isolate->GetCurrentContext()), Object); 2945 RETURN_TO_LOCAL_UNCHECKED(ToObject(isolate->GetCurrentContext()), Object);
2946 } 2946 }
2947 2947
2948 2948
(...skipping 5587 matching lines...) Expand 10 before | Expand all | Expand 10 after
8536 Address callback_address = 8536 Address callback_address =
8537 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8537 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8538 VMState<EXTERNAL> state(isolate); 8538 VMState<EXTERNAL> state(isolate);
8539 ExternalCallbackScope call_scope(isolate, callback_address); 8539 ExternalCallbackScope call_scope(isolate, callback_address);
8540 callback(info); 8540 callback(info);
8541 } 8541 }
8542 8542
8543 8543
8544 } // namespace internal 8544 } // namespace internal
8545 } // namespace v8 8545 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | src/builtins.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698