OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 8639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8650 | 8650 |
8651 // Otherwise, if the slot was found the holder is a context extension | 8651 // Otherwise, if the slot was found the holder is a context extension |
8652 // object, subject of a with, or a global object. We read the named | 8652 // object, subject of a with, or a global object. We read the named |
8653 // property from it. | 8653 // property from it. |
8654 if (!holder.is_null()) { | 8654 if (!holder.is_null()) { |
8655 Handle<JSObject> object = Handle<JSObject>::cast(holder); | 8655 Handle<JSObject> object = Handle<JSObject>::cast(holder); |
8656 ASSERT(object->HasProperty(*name)); | 8656 ASSERT(object->HasProperty(*name)); |
8657 // GetProperty below can cause GC. | 8657 // GetProperty below can cause GC. |
8658 Handle<Object> receiver_handle(object->IsGlobalObject() | 8658 Handle<Object> receiver_handle(object->IsGlobalObject() |
8659 ? GlobalObject::cast(*object)->global_receiver() | 8659 ? GlobalObject::cast(*object)->global_receiver() |
8660 : ComputeReceiverForNonGlobal(isolate, object)); | 8660 : ComputeReceiverForNonGlobal(isolate, *object)); |
8661 | 8661 |
8662 // No need to unhole the value here. This is taken care of by the | 8662 // No need to unhole the value here. This is taken care of by the |
8663 // GetProperty function. | 8663 // GetProperty function. |
8664 MaybeObject* value = object->GetProperty(*name); | 8664 MaybeObject* value = object->GetProperty(*name); |
8665 return MakePair(value, *receiver_handle); | 8665 return MakePair(value, *receiver_handle); |
8666 } | 8666 } |
8667 | 8667 |
8668 if (throw_error) { | 8668 if (throw_error) { |
8669 // The property doesn't exist - throw exception. | 8669 // The property doesn't exist - throw exception. |
8670 Handle<Object> reference_error = | 8670 Handle<Object> reference_error = |
(...skipping 4478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13149 } else { | 13149 } else { |
13150 // Handle last resort GC and make sure to allow future allocations | 13150 // Handle last resort GC and make sure to allow future allocations |
13151 // to grow the heap without causing GCs (if possible). | 13151 // to grow the heap without causing GCs (if possible). |
13152 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13152 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13153 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13153 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
13154 } | 13154 } |
13155 } | 13155 } |
13156 | 13156 |
13157 | 13157 |
13158 } } // namespace v8::internal | 13158 } } // namespace v8::internal |
OLD | NEW |