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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 AccessorPair* accessors = obj->GetLocalPropertyAccessorPair(*name); | 1102 AccessorPair* accessors = obj->GetLocalPropertyAccessorPair(*name); |
1103 | 1103 |
1104 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE); | 1104 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE); |
1105 elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0)); | 1105 elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0)); |
1106 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0)); | 1106 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0)); |
1107 elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(accessors != NULL)); | 1107 elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(accessors != NULL)); |
1108 | 1108 |
1109 if (accessors == NULL) { | 1109 if (accessors == NULL) { |
1110 elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0)); | 1110 elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0)); |
1111 // GetProperty does access check. | 1111 // GetProperty does access check. |
1112 elms->set(VALUE_INDEX, *GetProperty(obj, name)); | 1112 Handle<Object> value = GetProperty(obj, name); |
| 1113 elms->set(VALUE_INDEX, *value); |
1113 } else { | 1114 } else { |
1114 // Access checks are performed for both accessors separately. | 1115 // Access checks are performed for both accessors separately. |
1115 // When they fail, the respective field is not set in the descriptor. | 1116 // When they fail, the respective field is not set in the descriptor. |
1116 Object* getter = accessors->GetComponent(ACCESSOR_GETTER); | 1117 Object* getter = accessors->GetComponent(ACCESSOR_GETTER); |
1117 Object* setter = accessors->GetComponent(ACCESSOR_SETTER); | 1118 Object* setter = accessors->GetComponent(ACCESSOR_SETTER); |
1118 if (!getter->IsMap() && CheckPropertyAccess(*obj, *name, v8::ACCESS_GET)) { | 1119 if (!getter->IsMap() && CheckPropertyAccess(*obj, *name, v8::ACCESS_GET)) { |
1119 elms->set(GETTER_INDEX, getter); | 1120 elms->set(GETTER_INDEX, getter); |
1120 } | 1121 } |
1121 if (!setter->IsMap() && CheckPropertyAccess(*obj, *name, v8::ACCESS_SET)) { | 1122 if (!setter->IsMap() && CheckPropertyAccess(*obj, *name, v8::ACCESS_SET)) { |
1122 elms->set(SETTER_INDEX, setter); | 1123 elms->set(SETTER_INDEX, setter); |
(...skipping 12194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13317 // Handle last resort GC and make sure to allow future allocations | 13318 // Handle last resort GC and make sure to allow future allocations |
13318 // to grow the heap without causing GCs (if possible). | 13319 // to grow the heap without causing GCs (if possible). |
13319 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13320 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13320 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13321 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13321 "Runtime::PerformGC"); | 13322 "Runtime::PerformGC"); |
13322 } | 13323 } |
13323 } | 13324 } |
13324 | 13325 |
13325 | 13326 |
13326 } } // namespace v8::internal | 13327 } } // namespace v8::internal |
OLD | NEW |