| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 6631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6642 // The property was not found. It needs to be stored in the global context. | 6642 // The property was not found. It needs to be stored in the global context. |
| 6643 ASSERT(attributes == ABSENT); | 6643 ASSERT(attributes == ABSENT); |
| 6644 attributes = NONE; | 6644 attributes = NONE; |
| 6645 context_ext = Handle<JSObject>(Top::context()->global()); | 6645 context_ext = Handle<JSObject>(Top::context()->global()); |
| 6646 } | 6646 } |
| 6647 | 6647 |
| 6648 // Set the property, but ignore if read_only variable on the context | 6648 // Set the property, but ignore if read_only variable on the context |
| 6649 // extension object itself. | 6649 // extension object itself. |
| 6650 if ((attributes & READ_ONLY) == 0 || | 6650 if ((attributes & READ_ONLY) == 0 || |
| 6651 (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) { | 6651 (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) { |
| 6652 Handle<Object> set = SetProperty(context_ext, name, value, attributes); | 6652 Handle<Object> set = SetProperty(context_ext, name, value, NONE); |
| 6653 if (set.is_null()) { | 6653 if (set.is_null()) { |
| 6654 // Failure::Exception is converted to a null handle in the | 6654 // Failure::Exception is converted to a null handle in the |
| 6655 // handle-based methods such as SetProperty. We therefore need | 6655 // handle-based methods such as SetProperty. We therefore need |
| 6656 // to convert null handles back to exceptions. | 6656 // to convert null handles back to exceptions. |
| 6657 ASSERT(Top::has_pending_exception()); | 6657 ASSERT(Top::has_pending_exception()); |
| 6658 return Failure::Exception(); | 6658 return Failure::Exception(); |
| 6659 } | 6659 } |
| 6660 } | 6660 } |
| 6661 return *value; | 6661 return *value; |
| 6662 } | 6662 } |
| (...skipping 3493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10156 } else { | 10156 } else { |
| 10157 // Handle last resort GC and make sure to allow future allocations | 10157 // Handle last resort GC and make sure to allow future allocations |
| 10158 // to grow the heap without causing GCs (if possible). | 10158 // to grow the heap without causing GCs (if possible). |
| 10159 Counters::gc_last_resort_from_js.Increment(); | 10159 Counters::gc_last_resort_from_js.Increment(); |
| 10160 Heap::CollectAllGarbage(false); | 10160 Heap::CollectAllGarbage(false); |
| 10161 } | 10161 } |
| 10162 } | 10162 } |
| 10163 | 10163 |
| 10164 | 10164 |
| 10165 } } // namespace v8::internal | 10165 } } // namespace v8::internal |
| OLD | NEW |