| 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 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean(!result.IsDontDelete())); | 1116 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean(!result.IsDontDelete())); |
| 1117 | 1117 |
| 1118 bool is_js_accessor = (result.type() == CALLBACKS) && | 1118 bool is_js_accessor = (result.type() == CALLBACKS) && |
| 1119 (result.GetCallbackObject()->IsAccessorPair()); | 1119 (result.GetCallbackObject()->IsAccessorPair()); |
| 1120 | 1120 |
| 1121 if (is_js_accessor) { | 1121 if (is_js_accessor) { |
| 1122 // __defineGetter__/__defineSetter__ callback. | 1122 // __defineGetter__/__defineSetter__ callback. |
| 1123 elms->set(IS_ACCESSOR_INDEX, heap->true_value()); | 1123 elms->set(IS_ACCESSOR_INDEX, heap->true_value()); |
| 1124 | 1124 |
| 1125 AccessorPair* accessors = AccessorPair::cast(result.GetCallbackObject()); | 1125 AccessorPair* accessors = AccessorPair::cast(result.GetCallbackObject()); |
| 1126 if (CheckAccess(*obj, *name, &result, v8::ACCESS_GET)) { | 1126 Object* getter = accessors->GetComponent(ACCESSOR_GETTER); |
| 1127 elms->set(GETTER_INDEX, accessors->GetComponent(ACCESSOR_GETTER)); | 1127 if (!getter->IsMap() && CheckAccess(*obj, *name, &result, v8::ACCESS_GET)) { |
| 1128 elms->set(GETTER_INDEX, getter); |
| 1128 } | 1129 } |
| 1129 if (CheckAccess(*obj, *name, &result, v8::ACCESS_SET)) { | 1130 Object* setter = accessors->GetComponent(ACCESSOR_SETTER); |
| 1130 elms->set(SETTER_INDEX, accessors->GetComponent(ACCESSOR_SETTER)); | 1131 if (!setter->IsMap() && CheckAccess(*obj, *name, &result, v8::ACCESS_SET)) { |
| 1132 elms->set(SETTER_INDEX, setter); |
| 1131 } | 1133 } |
| 1132 } else { | 1134 } else { |
| 1133 elms->set(IS_ACCESSOR_INDEX, heap->false_value()); | 1135 elms->set(IS_ACCESSOR_INDEX, heap->false_value()); |
| 1134 elms->set(WRITABLE_INDEX, heap->ToBoolean(!result.IsReadOnly())); | 1136 elms->set(WRITABLE_INDEX, heap->ToBoolean(!result.IsReadOnly())); |
| 1135 | 1137 |
| 1136 PropertyAttributes attrs; | 1138 PropertyAttributes attrs; |
| 1137 Object* value; | 1139 Object* value; |
| 1138 // GetProperty will check access and report any violations. | 1140 // GetProperty will check access and report any violations. |
| 1139 { MaybeObject* maybe_value = obj->GetProperty(*obj, &result, *name, &attrs); | 1141 { MaybeObject* maybe_value = obj->GetProperty(*obj, &result, *name, &attrs); |
| 1140 if (!maybe_value->ToObject(&value)) return maybe_value; | 1142 if (!maybe_value->ToObject(&value)) return maybe_value; |
| (...skipping 12490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13631 // Handle last resort GC and make sure to allow future allocations | 13633 // Handle last resort GC and make sure to allow future allocations |
| 13632 // to grow the heap without causing GCs (if possible). | 13634 // to grow the heap without causing GCs (if possible). |
| 13633 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13635 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13634 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13636 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13635 "Runtime::PerformGC"); | 13637 "Runtime::PerformGC"); |
| 13636 } | 13638 } |
| 13637 } | 13639 } |
| 13638 | 13640 |
| 13639 | 13641 |
| 13640 } } // namespace v8::internal | 13642 } } // namespace v8::internal |
| OLD | NEW |