| 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 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3085 | 3085 |
| 3086 Local<String> Value::ToString(Isolate* isolate) const { | 3086 Local<String> Value::ToString(Isolate* isolate) const { |
| 3087 RETURN_TO_LOCAL_UNCHECKED(ToString(isolate->GetCurrentContext()), String); | 3087 RETURN_TO_LOCAL_UNCHECKED(ToString(isolate->GetCurrentContext()), String); |
| 3088 } | 3088 } |
| 3089 | 3089 |
| 3090 | 3090 |
| 3091 MaybeLocal<String> Value::ToDetailString(Local<Context> context) const { | 3091 MaybeLocal<String> Value::ToDetailString(Local<Context> context) const { |
| 3092 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 3092 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
| 3093 if (obj->IsString()) return ToApiHandle<String>(obj); | 3093 if (obj->IsString()) return ToApiHandle<String>(obj); |
| 3094 PREPARE_FOR_EXECUTION(context, Object, ToDetailString, String); | 3094 PREPARE_FOR_EXECUTION(context, Object, ToDetailString, String); |
| 3095 Local<String> result; | 3095 Local<String> result = |
| 3096 i::Handle<i::Object> args[] = {obj}; | 3096 Utils::ToLocal(i::Object::NoSideEffectsToString(isolate, obj)); |
| 3097 has_pending_exception = !ToLocal<String>( | |
| 3098 i::Execution::TryCall(isolate, isolate->no_side_effects_to_string_fun(), | |
| 3099 isolate->factory()->undefined_value(), | |
| 3100 arraysize(args), args), | |
| 3101 &result); | |
| 3102 RETURN_ON_FAILED_EXECUTION(String); | 3097 RETURN_ON_FAILED_EXECUTION(String); |
| 3103 RETURN_ESCAPED(result); | 3098 RETURN_ESCAPED(result); |
| 3104 } | 3099 } |
| 3105 | 3100 |
| 3106 | 3101 |
| 3107 Local<String> Value::ToDetailString(Isolate* isolate) const { | 3102 Local<String> Value::ToDetailString(Isolate* isolate) const { |
| 3108 RETURN_TO_LOCAL_UNCHECKED(ToDetailString(isolate->GetCurrentContext()), | 3103 RETURN_TO_LOCAL_UNCHECKED(ToDetailString(isolate->GetCurrentContext()), |
| 3109 String); | 3104 String); |
| 3110 } | 3105 } |
| 3111 | 3106 |
| (...skipping 5885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8997 Address callback_address = | 8992 Address callback_address = |
| 8998 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8993 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8999 VMState<EXTERNAL> state(isolate); | 8994 VMState<EXTERNAL> state(isolate); |
| 9000 ExternalCallbackScope call_scope(isolate, callback_address); | 8995 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9001 callback(info); | 8996 callback(info); |
| 9002 } | 8997 } |
| 9003 | 8998 |
| 9004 | 8999 |
| 9005 } // namespace internal | 9000 } // namespace internal |
| 9006 } // namespace v8 | 9001 } // namespace v8 |
| OLD | NEW |