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 9234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9245 | 9245 |
9246 // Otherwise, if the slot was found the holder is a context extension | 9246 // Otherwise, if the slot was found the holder is a context extension |
9247 // object, subject of a with, or a global object. We read the named | 9247 // object, subject of a with, or a global object. We read the named |
9248 // property from it. | 9248 // property from it. |
9249 if (!holder.is_null()) { | 9249 if (!holder.is_null()) { |
9250 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); | 9250 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); |
9251 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name)); | 9251 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name)); |
9252 // GetProperty below can cause GC. | 9252 // GetProperty below can cause GC. |
9253 Handle<Object> receiver_handle( | 9253 Handle<Object> receiver_handle( |
9254 object->IsGlobalObject() | 9254 object->IsGlobalObject() |
9255 ? Object::cast(isolate->heap()->the_hole_value()) | 9255 ? GlobalObject::cast(*object)->global_receiver() |
9256 : object->IsJSProxy() ? static_cast<Object*>(*object) | 9256 : object->IsJSProxy() ? static_cast<Object*>(*object) |
9257 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), | 9257 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), |
9258 isolate); | 9258 isolate); |
9259 | 9259 |
9260 // No need to unhole the value here. This is taken care of by the | 9260 // No need to unhole the value here. This is taken care of by the |
9261 // GetProperty function. | 9261 // GetProperty function. |
9262 MaybeObject* value = object->GetProperty(*name); | 9262 MaybeObject* value = object->GetProperty(*name); |
9263 return MakePair(value, *receiver_handle); | 9263 return MakePair(value, *receiver_handle); |
9264 } | 9264 } |
9265 | 9265 |
(...skipping 5625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14891 // Handle last resort GC and make sure to allow future allocations | 14891 // Handle last resort GC and make sure to allow future allocations |
14892 // to grow the heap without causing GCs (if possible). | 14892 // to grow the heap without causing GCs (if possible). |
14893 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14893 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14894 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14894 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14895 "Runtime::PerformGC"); | 14895 "Runtime::PerformGC"); |
14896 } | 14896 } |
14897 } | 14897 } |
14898 | 14898 |
14899 | 14899 |
14900 } } // namespace v8::internal | 14900 } } // namespace v8::internal |
OLD | NEW |