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

Side by Side Diff: src/api.cc

Issue 1964433002: Expose IsConstructor to the C++ API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « include/v8.h ('k') | test/cctest/test-api.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 4345 matching lines...) Expand 10 before | Expand all | Expand 10 after
4356 auto self = Utils::OpenHandle(this); 4356 auto self = Utils::OpenHandle(this);
4357 return i::JSReceiver::GetOrCreateIdentityHash(self)->value(); 4357 return i::JSReceiver::GetOrCreateIdentityHash(self)->value();
4358 } 4358 }
4359 4359
4360 4360
4361 bool v8::Object::IsCallable() { 4361 bool v8::Object::IsCallable() {
4362 auto self = Utils::OpenHandle(this); 4362 auto self = Utils::OpenHandle(this);
4363 return self->IsCallable(); 4363 return self->IsCallable();
4364 } 4364 }
4365 4365
4366 bool v8::Object::IsConstructor() {
4367 auto self = Utils::OpenHandle(this);
4368 return self->IsConstructor();
4369 }
4366 4370
4367 MaybeLocal<Value> Object::CallAsFunction(Local<Context> context, 4371 MaybeLocal<Value> Object::CallAsFunction(Local<Context> context,
4368 Local<Value> recv, int argc, 4372 Local<Value> recv, int argc,
4369 Local<Value> argv[]) { 4373 Local<Value> argv[]) {
4370 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Object::CallAsFunction()", 4374 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Object::CallAsFunction()",
4371 Value); 4375 Value);
4372 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); 4376 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
4373 TRACE_EVENT0("v8", "V8.Execute"); 4377 TRACE_EVENT0("v8", "V8.Execute");
4374 auto self = Utils::OpenHandle(this); 4378 auto self = Utils::OpenHandle(this);
4375 auto recv_obj = Utils::OpenHandle(*recv); 4379 auto recv_obj = Utils::OpenHandle(*recv);
(...skipping 4425 matching lines...) Expand 10 before | Expand all | Expand 10 after
8801 Address callback_address = 8805 Address callback_address =
8802 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8806 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8803 VMState<EXTERNAL> state(isolate); 8807 VMState<EXTERNAL> state(isolate);
8804 ExternalCallbackScope call_scope(isolate, callback_address); 8808 ExternalCallbackScope call_scope(isolate, callback_address);
8805 callback(info); 8809 callback(info);
8806 } 8810 }
8807 8811
8808 8812
8809 } // namespace internal 8813 } // namespace internal
8810 } // namespace v8 8814 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698