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 4037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4048 Handle<Value> Function::GetDisplayName() const { | 4048 Handle<Value> Function::GetDisplayName() const { |
4049 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 4049 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
4050 ON_BAILOUT(isolate, "v8::Function::GetDisplayName()", | 4050 ON_BAILOUT(isolate, "v8::Function::GetDisplayName()", |
4051 return ToApiHandle<Primitive>( | 4051 return ToApiHandle<Primitive>( |
4052 isolate->factory()->undefined_value())); | 4052 isolate->factory()->undefined_value())); |
4053 ENTER_V8(isolate); | 4053 ENTER_V8(isolate); |
4054 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); | 4054 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); |
4055 i::Handle<i::String> property_name = | 4055 i::Handle<i::String> property_name = |
4056 isolate->factory()->InternalizeOneByteString( | 4056 isolate->factory()->InternalizeOneByteString( |
4057 STATIC_ASCII_VECTOR("displayName")); | 4057 STATIC_ASCII_VECTOR("displayName")); |
4058 i::LookupIterator it(func, property_name, | |
4059 i::LookupIterator::CHECK_DERIVED_PROPERTY); | |
4060 | 4058 |
4061 i::Handle<i::Object> value = | 4059 i::Handle<i::Object> value = |
4062 i::JSObject::GetDataProperty(func, property_name); | 4060 i::JSObject::GetDataProperty(func, property_name); |
4063 if (value->IsString()) { | 4061 if (value->IsString()) { |
4064 i::Handle<i::String> name = i::Handle<i::String>::cast(value); | 4062 i::Handle<i::String> name = i::Handle<i::String>::cast(value); |
4065 if (name->length() > 0) return Utils::ToLocal(name); | 4063 if (name->length() > 0) return Utils::ToLocal(name); |
4066 } | 4064 } |
4067 | 4065 |
4068 return ToApiHandle<Primitive>(isolate->factory()->undefined_value()); | 4066 return ToApiHandle<Primitive>(isolate->factory()->undefined_value()); |
4069 } | 4067 } |
(...skipping 3580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7650 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7648 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7651 Address callback_address = | 7649 Address callback_address = |
7652 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7650 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7653 VMState<EXTERNAL> state(isolate); | 7651 VMState<EXTERNAL> state(isolate); |
7654 ExternalCallbackScope call_scope(isolate, callback_address); | 7652 ExternalCallbackScope call_scope(isolate, callback_address); |
7655 callback(info); | 7653 callback(info); |
7656 } | 7654 } |
7657 | 7655 |
7658 | 7656 |
7659 } } // namespace v8::internal | 7657 } } // namespace v8::internal |
OLD | NEW |