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 3883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3894 } | 3894 } |
3895 | 3895 |
3896 | 3896 |
3897 Local<Array> v8::Object::GetPropertyNames() { | 3897 Local<Array> v8::Object::GetPropertyNames() { |
3898 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | 3898 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); |
3899 RETURN_TO_LOCAL_UNCHECKED(GetPropertyNames(context), Array); | 3899 RETURN_TO_LOCAL_UNCHECKED(GetPropertyNames(context), Array); |
3900 } | 3900 } |
3901 | 3901 |
3902 | 3902 |
3903 MaybeLocal<Array> v8::Object::GetOwnPropertyNames(Local<Context> context) { | 3903 MaybeLocal<Array> v8::Object::GetOwnPropertyNames(Local<Context> context) { |
3904 return GetOwnPropertyNames( | |
3905 context, static_cast<v8::PropertyFilter>(ONLY_ENUMERABLE | SKIP_SYMBOLS)); | |
3906 } | |
3907 | |
3908 Local<Array> v8::Object::GetOwnPropertyNames() { | |
3909 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | |
3910 RETURN_TO_LOCAL_UNCHECKED(GetOwnPropertyNames(context), Array); | |
3911 } | |
3912 | |
3913 MaybeLocal<Array> v8::Object::GetOwnPropertyNames(Local<Context> context, | |
3914 PropertyFilter filter) { | |
3904 PREPARE_FOR_EXECUTION(context, "v8::Object::GetOwnPropertyNames()", Array); | 3915 PREPARE_FOR_EXECUTION(context, "v8::Object::GetOwnPropertyNames()", Array); |
3905 auto self = Utils::OpenHandle(this); | 3916 auto self = Utils::OpenHandle(this); |
3906 i::Handle<i::FixedArray> value; | 3917 i::Handle<i::FixedArray> value; |
3907 has_pending_exception = | 3918 has_pending_exception = |
3908 !i::JSReceiver::GetKeys(self, i::OWN_ONLY, i::ENUMERABLE_STRINGS) | 3919 !i::JSReceiver::GetKeys(self, i::OWN_ONLY, |
3920 static_cast<i::PropertyFilter>(filter)) | |
Yang
2016/05/03 13:50:20
Please add static checks to property-details.h tha
kozy
2016/05/03 17:37:46
Done.
| |
3909 .ToHandle(&value); | 3921 .ToHandle(&value); |
3910 RETURN_ON_FAILED_EXECUTION(Array); | 3922 RETURN_ON_FAILED_EXECUTION(Array); |
3911 DCHECK(self->map()->EnumLength() == i::kInvalidEnumCacheSentinel || | 3923 DCHECK(self->map()->EnumLength() == i::kInvalidEnumCacheSentinel || |
3912 self->map()->EnumLength() == 0 || | 3924 self->map()->EnumLength() == 0 || |
3913 self->map()->instance_descriptors()->GetEnumCache() != *value); | 3925 self->map()->instance_descriptors()->GetEnumCache() != *value); |
3914 auto result = isolate->factory()->NewJSArrayWithElements(value); | 3926 auto result = isolate->factory()->NewJSArrayWithElements(value); |
3915 RETURN_ESCAPED(Utils::ToLocal(result)); | 3927 RETURN_ESCAPED(Utils::ToLocal(result)); |
3916 } | 3928 } |
3917 | 3929 |
3918 | 3930 |
3919 Local<Array> v8::Object::GetOwnPropertyNames() { | |
3920 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | |
3921 RETURN_TO_LOCAL_UNCHECKED(GetOwnPropertyNames(context), Array); | |
3922 } | |
3923 | |
3924 | |
3925 MaybeLocal<String> v8::Object::ObjectProtoToString(Local<Context> context) { | 3931 MaybeLocal<String> v8::Object::ObjectProtoToString(Local<Context> context) { |
3926 PREPARE_FOR_EXECUTION(context, "v8::Object::ObjectProtoToString", String); | 3932 PREPARE_FOR_EXECUTION(context, "v8::Object::ObjectProtoToString", String); |
3927 auto obj = Utils::OpenHandle(this); | 3933 auto obj = Utils::OpenHandle(this); |
3928 Local<String> result; | 3934 Local<String> result; |
3929 has_pending_exception = | 3935 has_pending_exception = |
3930 !ToLocal<String>(i::JSObject::ObjectProtoToString(isolate, obj), &result); | 3936 !ToLocal<String>(i::JSObject::ObjectProtoToString(isolate, obj), &result); |
3931 RETURN_ON_FAILED_EXECUTION(String); | 3937 RETURN_ON_FAILED_EXECUTION(String); |
3932 RETURN_ESCAPED(result); | 3938 RETURN_ESCAPED(result); |
3933 } | 3939 } |
3934 | 3940 |
(...skipping 4914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8849 Address callback_address = | 8855 Address callback_address = |
8850 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8856 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8851 VMState<EXTERNAL> state(isolate); | 8857 VMState<EXTERNAL> state(isolate); |
8852 ExternalCallbackScope call_scope(isolate, callback_address); | 8858 ExternalCallbackScope call_scope(isolate, callback_address); |
8853 callback(info); | 8859 callback(info); |
8854 } | 8860 } |
8855 | 8861 |
8856 | 8862 |
8857 } // namespace internal | 8863 } // namespace internal |
8858 } // namespace v8 | 8864 } // namespace v8 |
OLD | NEW |