OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 case ACCESS_ALLOWED: break; | 1919 case ACCESS_ALLOWED: break; |
1920 case ACCESS_ABSENT: return factory->undefined_value(); | 1920 case ACCESS_ABSENT: return factory->undefined_value(); |
1921 } | 1921 } |
1922 | 1922 |
1923 PropertyAttributes attrs = JSReceiver::GetLocalPropertyAttribute(obj, name); | 1923 PropertyAttributes attrs = JSReceiver::GetLocalPropertyAttribute(obj, name); |
1924 if (attrs == ABSENT) { | 1924 if (attrs == ABSENT) { |
1925 RETURN_HANDLE_IF_SCHEDULED_EXCEPTION(isolate, Object); | 1925 RETURN_HANDLE_IF_SCHEDULED_EXCEPTION(isolate, Object); |
1926 return factory->undefined_value(); | 1926 return factory->undefined_value(); |
1927 } | 1927 } |
1928 ASSERT(!isolate->has_scheduled_exception()); | 1928 ASSERT(!isolate->has_scheduled_exception()); |
1929 AccessorPair* raw_accessors = obj->GetLocalPropertyAccessorPair(*name); | 1929 Handle<AccessorPair> accessors; |
1930 Handle<AccessorPair> accessors(raw_accessors, isolate); | 1930 bool has_accessors = |
| 1931 JSObject::GetLocalPropertyAccessorPair(obj, name).ToHandle(&accessors); |
1931 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE); | 1932 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE); |
1932 elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0)); | 1933 elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0)); |
1933 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0)); | 1934 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0)); |
1934 elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(raw_accessors != NULL)); | 1935 elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(has_accessors)); |
1935 | 1936 |
1936 if (raw_accessors == NULL) { | 1937 if (!has_accessors) { |
1937 elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0)); | 1938 elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0)); |
1938 // Runtime::GetObjectProperty does access check. | 1939 // Runtime::GetObjectProperty does access check. |
1939 Handle<Object> value = Runtime::GetObjectProperty(isolate, obj, name); | 1940 Handle<Object> value = Runtime::GetObjectProperty(isolate, obj, name); |
1940 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, value, Handle<Object>::null()); | 1941 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, value, Handle<Object>::null()); |
1941 elms->set(VALUE_INDEX, *value); | 1942 elms->set(VALUE_INDEX, *value); |
1942 } else { | 1943 } else { |
1943 // Access checks are performed for both accessors separately. | 1944 // Access checks are performed for both accessors separately. |
1944 // When they fail, the respective field is not set in the descriptor. | 1945 // When they fail, the respective field is not set in the descriptor. |
1945 Handle<Object> getter(accessors->GetComponent(ACCESSOR_GETTER), isolate); | 1946 Handle<Object> getter(accessors->GetComponent(ACCESSOR_GETTER), isolate); |
1946 Handle<Object> setter(accessors->GetComponent(ACCESSOR_SETTER), isolate); | 1947 Handle<Object> setter(accessors->GetComponent(ACCESSOR_SETTER), isolate); |
(...skipping 13311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15258 } | 15259 } |
15259 } | 15260 } |
15260 | 15261 |
15261 | 15262 |
15262 void Runtime::OutOfMemory() { | 15263 void Runtime::OutOfMemory() { |
15263 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); | 15264 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); |
15264 UNREACHABLE(); | 15265 UNREACHABLE(); |
15265 } | 15266 } |
15266 | 15267 |
15267 } } // namespace v8::internal | 15268 } } // namespace v8::internal |
OLD | NEW |