| 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 9228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9239 | 9239 |
| 9240 // Otherwise, if the slot was found the holder is a context extension | 9240 // Otherwise, if the slot was found the holder is a context extension |
| 9241 // object, subject of a with, or a global object. We read the named | 9241 // object, subject of a with, or a global object. We read the named |
| 9242 // property from it. | 9242 // property from it. |
| 9243 if (!holder.is_null()) { | 9243 if (!holder.is_null()) { |
| 9244 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); | 9244 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); |
| 9245 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name)); | 9245 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name)); |
| 9246 // GetProperty below can cause GC. | 9246 // GetProperty below can cause GC. |
| 9247 Handle<Object> receiver_handle( | 9247 Handle<Object> receiver_handle( |
| 9248 object->IsGlobalObject() | 9248 object->IsGlobalObject() |
| 9249 ? GlobalObject::cast(*object)->global_receiver() | 9249 ? Object::cast(isolate->heap()->the_hole_value()) |
| 9250 : object->IsJSProxy() ? static_cast<Object*>(*object) | 9250 : object->IsJSProxy() ? static_cast<Object*>(*object) |
| 9251 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), | 9251 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), |
| 9252 isolate); | 9252 isolate); |
| 9253 | 9253 |
| 9254 // No need to unhole the value here. This is taken care of by the | 9254 // No need to unhole the value here. This is taken care of by the |
| 9255 // GetProperty function. | 9255 // GetProperty function. |
| 9256 MaybeObject* value = object->GetProperty(*name); | 9256 MaybeObject* value = object->GetProperty(*name); |
| 9257 return MakePair(value, *receiver_handle); | 9257 return MakePair(value, *receiver_handle); |
| 9258 } | 9258 } |
| 9259 | 9259 |
| (...skipping 5643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14903 // Handle last resort GC and make sure to allow future allocations | 14903 // Handle last resort GC and make sure to allow future allocations |
| 14904 // to grow the heap without causing GCs (if possible). | 14904 // to grow the heap without causing GCs (if possible). |
| 14905 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14905 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14906 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14906 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14907 "Runtime::PerformGC"); | 14907 "Runtime::PerformGC"); |
| 14908 } | 14908 } |
| 14909 } | 14909 } |
| 14910 | 14910 |
| 14911 | 14911 |
| 14912 } } // namespace v8::internal | 14912 } } // namespace v8::internal |
| OLD | NEW |