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/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 Handle<JSObject> js_object = Handle<JSObject>::cast(receiver); | 1862 Handle<JSObject> js_object = Handle<JSObject>::cast(receiver); |
1863 DCHECK(!js_object->HasNamedInterceptor()); | 1863 DCHECK(!js_object->HasNamedInterceptor()); |
1864 DCHECK(!js_object->IsAccessCheckNeeded()); | 1864 DCHECK(!js_object->IsAccessCheckNeeded()); |
1865 DCHECK(!js_object->map()->has_hidden_prototype()); | 1865 DCHECK(!js_object->map()->has_hidden_prototype()); |
1866 DCHECK(js_object->HasFastProperties()); | 1866 DCHECK(js_object->HasFastProperties()); |
1867 if (js_object->elements() == isolate->heap()->empty_fixed_array()) { | 1867 if (js_object->elements() == isolate->heap()->empty_fixed_array()) { |
1868 keys = isolate->factory()->NewFixedArray(enum_length); | 1868 keys = isolate->factory()->NewFixedArray(enum_length); |
1869 if (enum_length != 0) { | 1869 if (enum_length != 0) { |
1870 Handle<FixedArray> cache( | 1870 Handle<FixedArray> cache( |
1871 js_object->map()->instance_descriptors()->GetEnumCache()); | 1871 js_object->map()->instance_descriptors()->GetEnumCache()); |
1872 keys = isolate->factory()->NewFixedArray(enum_length); | 1872 keys = isolate->factory()->CopyFixedArrayUpTo(cache, enum_length); |
1873 for (int i = 0; i < enum_length; i++) { | |
1874 keys->set(i, cache->get(i)); | |
1875 } | |
1876 } | 1873 } |
1877 } | 1874 } |
1878 } | 1875 } |
1879 | 1876 |
1880 if (keys.is_null()) { | 1877 if (keys.is_null()) { |
1881 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1878 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1882 isolate, keys, | 1879 isolate, keys, |
1883 JSReceiver::GetKeys(receiver, OWN_ONLY, ENUMERABLE_STRINGS, | 1880 JSReceiver::GetKeys(receiver, OWN_ONLY, ENUMERABLE_STRINGS, |
1884 CONVERT_TO_STRING)); | 1881 CONVERT_TO_STRING)); |
1885 } | 1882 } |
(...skipping 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4387 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 4384 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
4388 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 4385 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
4389 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 4386 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
4390 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 4387 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
4391 #undef DEFINE_BUILTIN_ACCESSOR_C | 4388 #undef DEFINE_BUILTIN_ACCESSOR_C |
4392 #undef DEFINE_BUILTIN_ACCESSOR_A | 4389 #undef DEFINE_BUILTIN_ACCESSOR_A |
4393 | 4390 |
4394 | 4391 |
4395 } // namespace internal | 4392 } // namespace internal |
4396 } // namespace v8 | 4393 } // namespace v8 |
OLD | NEW |