| 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 4443 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4454 | 4454 | 
| 4455 Local<Value> Function::GetDisplayName() const { | 4455 Local<Value> Function::GetDisplayName() const { | 
| 4456   i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 4456   i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 
| 4457   ENTER_V8(isolate); | 4457   ENTER_V8(isolate); | 
| 4458   auto self = Utils::OpenHandle(this); | 4458   auto self = Utils::OpenHandle(this); | 
| 4459   if (!self->IsJSFunction()) { | 4459   if (!self->IsJSFunction()) { | 
| 4460     return ToApiHandle<Primitive>(isolate->factory()->undefined_value()); | 4460     return ToApiHandle<Primitive>(isolate->factory()->undefined_value()); | 
| 4461   } | 4461   } | 
| 4462   auto func = i::Handle<i::JSFunction>::cast(self); | 4462   auto func = i::Handle<i::JSFunction>::cast(self); | 
| 4463   i::Handle<i::String> property_name = | 4463   i::Handle<i::String> property_name = | 
| 4464       isolate->factory()->display_name_string(); | 4464       isolate->factory()->NewStringFromStaticChars("displayName"); | 
| 4465   i::Handle<i::Object> value = | 4465   i::Handle<i::Object> value = | 
| 4466       i::JSReceiver::GetDataProperty(func, property_name); | 4466       i::JSReceiver::GetDataProperty(func, property_name); | 
| 4467   if (value->IsString()) { | 4467   if (value->IsString()) { | 
| 4468     i::Handle<i::String> name = i::Handle<i::String>::cast(value); | 4468     i::Handle<i::String> name = i::Handle<i::String>::cast(value); | 
| 4469     if (name->length() > 0) return Utils::ToLocal(name); | 4469     if (name->length() > 0) return Utils::ToLocal(name); | 
| 4470   } | 4470   } | 
| 4471   return ToApiHandle<Primitive>(isolate->factory()->undefined_value()); | 4471   return ToApiHandle<Primitive>(isolate->factory()->undefined_value()); | 
| 4472 } | 4472 } | 
| 4473 | 4473 | 
| 4474 | 4474 | 
| (...skipping 4087 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 8562   Address callback_address = | 8562   Address callback_address = | 
| 8563       reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8563       reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 
| 8564   VMState<EXTERNAL> state(isolate); | 8564   VMState<EXTERNAL> state(isolate); | 
| 8565   ExternalCallbackScope call_scope(isolate, callback_address); | 8565   ExternalCallbackScope call_scope(isolate, callback_address); | 
| 8566   callback(info); | 8566   callback(info); | 
| 8567 } | 8567 } | 
| 8568 | 8568 | 
| 8569 | 8569 | 
| 8570 }  // namespace internal | 8570 }  // namespace internal | 
| 8571 }  // namespace v8 | 8571 }  // namespace v8 | 
| OLD | NEW | 
|---|