| 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 9211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9222 | 9222 |
| 9223 // Otherwise, if the slot was found the holder is a context extension | 9223 // Otherwise, if the slot was found the holder is a context extension |
| 9224 // object, subject of a with, or a global object. We read the named | 9224 // object, subject of a with, or a global object. We read the named |
| 9225 // property from it. | 9225 // property from it. |
| 9226 if (!holder.is_null()) { | 9226 if (!holder.is_null()) { |
| 9227 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); | 9227 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); |
| 9228 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name)); | 9228 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name)); |
| 9229 // GetProperty below can cause GC. | 9229 // GetProperty below can cause GC. |
| 9230 Handle<Object> receiver_handle( | 9230 Handle<Object> receiver_handle( |
| 9231 object->IsGlobalObject() | 9231 object->IsGlobalObject() |
| 9232 ? GlobalObject::cast(*object)->global_receiver() | 9232 ? Object::cast(isolate->heap()->the_hole_value()) |
| 9233 : object->IsJSProxy() ? static_cast<Object*>(*object) | 9233 : object->IsJSProxy() ? static_cast<Object*>(*object) |
| 9234 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), | 9234 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), |
| 9235 isolate); | 9235 isolate); |
| 9236 | 9236 |
| 9237 // No need to unhole the value here. This is taken care of by the | 9237 // No need to unhole the value here. This is taken care of by the |
| 9238 // GetProperty function. | 9238 // GetProperty function. |
| 9239 MaybeObject* value = object->GetProperty(*name); | 9239 MaybeObject* value = object->GetProperty(*name); |
| 9240 return MakePair(value, *receiver_handle); | 9240 return MakePair(value, *receiver_handle); |
| 9241 } | 9241 } |
| 9242 | 9242 |
| (...skipping 5625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14868 // Handle last resort GC and make sure to allow future allocations | 14868 // Handle last resort GC and make sure to allow future allocations |
| 14869 // to grow the heap without causing GCs (if possible). | 14869 // to grow the heap without causing GCs (if possible). |
| 14870 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14870 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14871 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14871 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14872 "Runtime::PerformGC"); | 14872 "Runtime::PerformGC"); |
| 14873 } | 14873 } |
| 14874 } | 14874 } |
| 14875 | 14875 |
| 14876 | 14876 |
| 14877 } } // namespace v8::internal | 14877 } } // namespace v8::internal |
| OLD | NEW |