OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 3421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3432 // ECMA-262, 3rd., 10.1.6 and 10.2.3. | 3432 // ECMA-262, 3rd., 10.1.6 and 10.2.3. |
3433 JSObject* receiver = Top::context()->global()->global_receiver(); | 3433 JSObject* receiver = Top::context()->global()->global_receiver(); |
3434 Object* value = (holder->IsContext()) | 3434 Object* value = (holder->IsContext()) |
3435 ? Context::cast(*holder)->get(index) | 3435 ? Context::cast(*holder)->get(index) |
3436 : JSObject::cast(*holder)->GetElement(index); | 3436 : JSObject::cast(*holder)->GetElement(index); |
3437 return MakePair(Unhole(value, attributes), receiver); | 3437 return MakePair(Unhole(value, attributes), receiver); |
3438 } | 3438 } |
3439 | 3439 |
3440 // If the holder is found, we read the property from it. | 3440 // If the holder is found, we read the property from it. |
3441 if (!holder.is_null() && holder->IsJSObject()) { | 3441 if (!holder.is_null() && holder->IsJSObject()) { |
| 3442 ASSERT(Handle<JSObject>::cast(holder)->HasProperty(*name)); |
3442 JSObject* object = JSObject::cast(*holder); | 3443 JSObject* object = JSObject::cast(*holder); |
3443 ASSERT(object->HasProperty(*name)); | |
3444 JSObject* receiver = (object->IsGlobalObject()) | 3444 JSObject* receiver = (object->IsGlobalObject()) |
3445 ? GlobalObject::cast(object)->global_receiver() | 3445 ? GlobalObject::cast(object)->global_receiver() |
3446 : ComputeReceiverForNonGlobal(object); | 3446 : ComputeReceiverForNonGlobal(object); |
3447 // No need to unhole the value here. This is taken care of by the | 3447 // No need to unhole the value here. This is taken care of by the |
3448 // GetProperty function. | 3448 // GetProperty function. |
3449 Object* value = object->GetProperty(*name); | 3449 Object* value = object->GetProperty(*name); |
3450 return MakePair(value, receiver); | 3450 return MakePair(value, receiver); |
3451 } | 3451 } |
3452 | 3452 |
3453 if (throw_error) { | 3453 if (throw_error) { |
(...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5787 } else { | 5787 } else { |
5788 // Handle last resort GC and make sure to allow future allocations | 5788 // Handle last resort GC and make sure to allow future allocations |
5789 // to grow the heap without causing GCs (if possible). | 5789 // to grow the heap without causing GCs (if possible). |
5790 Counters::gc_last_resort_from_js.Increment(); | 5790 Counters::gc_last_resort_from_js.Increment(); |
5791 Heap::CollectAllGarbage(); | 5791 Heap::CollectAllGarbage(); |
5792 } | 5792 } |
5793 } | 5793 } |
5794 | 5794 |
5795 | 5795 |
5796 } } // namespace v8::internal | 5796 } } // namespace v8::internal |
OLD | NEW |