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

Side by Side Diff: src/api.cc

Issue 2206573002: Move NoSideEffectToString to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 4 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/bootstrapper.cc » ('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 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698