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

Side by Side Diff: src/api.cc

Issue 2603493002: Remove duplicate C++ implementation of Object.prototype.toString (Closed)
Patch Set: Created 3 years, 12 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 4457 matching lines...) Expand 10 before | Expand all | Expand 10 after
4468 } 4468 }
4469 4469
4470 MaybeLocal<Array> v8::Object::GetOwnPropertyNames(Local<Context> context, 4470 MaybeLocal<Array> v8::Object::GetOwnPropertyNames(Local<Context> context,
4471 PropertyFilter filter) { 4471 PropertyFilter filter) {
4472 return GetPropertyNames(context, KeyCollectionMode::kOwnOnly, filter, 4472 return GetPropertyNames(context, KeyCollectionMode::kOwnOnly, filter,
4473 v8::IndexFilter::kIncludeIndices); 4473 v8::IndexFilter::kIncludeIndices);
4474 } 4474 }
4475 4475
4476 MaybeLocal<String> v8::Object::ObjectProtoToString(Local<Context> context) { 4476 MaybeLocal<String> v8::Object::ObjectProtoToString(Local<Context> context) {
4477 PREPARE_FOR_EXECUTION(context, Object, ObjectProtoToString, String); 4477 PREPARE_FOR_EXECUTION(context, Object, ObjectProtoToString, String);
4478 auto obj = Utils::OpenHandle(this); 4478 auto self = Utils::OpenHandle(this);
4479 Local<String> result; 4479 Local<Value> result;
4480 has_pending_exception = 4480 has_pending_exception =
4481 !ToLocal<String>(i::JSObject::ObjectProtoToString(isolate, obj), &result); 4481 !ToLocal<Value>(i::Execution::Call(isolate, isolate->object_to_string(),
4482 self, 0, nullptr),
4483 &result);
4482 RETURN_ON_FAILED_EXECUTION(String); 4484 RETURN_ON_FAILED_EXECUTION(String);
4483 RETURN_ESCAPED(result); 4485 RETURN_ESCAPED(Local<String>::Cast(result));
4484 } 4486 }
4485 4487
4486 4488
4487 Local<String> v8::Object::ObjectProtoToString() { 4489 Local<String> v8::Object::ObjectProtoToString() {
4488 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 4490 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
4489 RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String); 4491 RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String);
4490 } 4492 }
4491 4493
4492 4494
4493 Local<String> v8::Object::GetConstructorName() { 4495 Local<String> v8::Object::GetConstructorName() {
(...skipping 5428 matching lines...) Expand 10 before | Expand all | Expand 10 after
9922 Address callback_address = 9924 Address callback_address =
9923 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9925 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9924 VMState<EXTERNAL> state(isolate); 9926 VMState<EXTERNAL> state(isolate);
9925 ExternalCallbackScope call_scope(isolate, callback_address); 9927 ExternalCallbackScope call_scope(isolate, callback_address);
9926 callback(info); 9928 callback(info);
9927 } 9929 }
9928 9930
9929 9931
9930 } // namespace internal 9932 } // namespace internal
9931 } // namespace v8 9933 } // 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