| 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 | 1102 |
| 1103 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE); | 1103 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE); |
| 1104 elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0)); | 1104 elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0)); |
| 1105 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0)); | 1105 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0)); |
| 1106 elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(accessors != NULL)); | 1106 elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(accessors != NULL)); |
| 1107 | 1107 |
| 1108 if (accessors == NULL) { | 1108 if (accessors == NULL) { |
| 1109 elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0)); | 1109 elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0)); |
| 1110 // GetProperty does access check. | 1110 // GetProperty does access check. |
| 1111 Handle<Object> value = GetProperty(obj, name); | 1111 Handle<Object> value = GetProperty(obj, name); |
| 1112 if (value.is_null()) return Failure::Exception(); |
| 1112 elms->set(VALUE_INDEX, *value); | 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)) { |
| (...skipping 12182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13304 // Handle last resort GC and make sure to allow future allocations | 13305 // Handle last resort GC and make sure to allow future allocations |
| 13305 // to grow the heap without causing GCs (if possible). | 13306 // to grow the heap without causing GCs (if possible). |
| 13306 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13307 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13307 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13308 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13308 "Runtime::PerformGC"); | 13309 "Runtime::PerformGC"); |
| 13309 } | 13310 } |
| 13310 } | 13311 } |
| 13311 | 13312 |
| 13312 | 13313 |
| 13313 } } // namespace v8::internal | 13314 } } // namespace v8::internal |
| OLD | NEW |