| 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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 } | 1634 } |
| 1635 return current; | 1635 return current; |
| 1636 } | 1636 } |
| 1637 | 1637 |
| 1638 | 1638 |
| 1639 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) { | 1639 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) { |
| 1640 HandleScope scope(isolate); | 1640 HandleScope scope(isolate); |
| 1641 ASSERT(args.length() == 2); | 1641 ASSERT(args.length() == 2); |
| 1642 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 1642 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
| 1643 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 1643 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
| 1644 if (FLAG_harmony_observation && obj->map()->is_observed()) { | 1644 if (obj->map()->is_observed()) { |
| 1645 Handle<Object> old_value( | 1645 Handle<Object> old_value( |
| 1646 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); | 1646 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); |
| 1647 | 1647 |
| 1648 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); | 1648 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); |
| 1649 RETURN_IF_EMPTY_HANDLE(isolate, result); | 1649 RETURN_IF_EMPTY_HANDLE(isolate, result); |
| 1650 | 1650 |
| 1651 Handle<Object> new_value( | 1651 Handle<Object> new_value( |
| 1652 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); | 1652 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); |
| 1653 if (!new_value->SameValue(*old_value)) { | 1653 if (!new_value->SameValue(*old_value)) { |
| 1654 JSObject::EnqueueChangeRecord(obj, "setPrototype", | 1654 JSObject::EnqueueChangeRecord(obj, "setPrototype", |
| (...skipping 13320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14975 // Handle last resort GC and make sure to allow future allocations | 14975 // Handle last resort GC and make sure to allow future allocations |
| 14976 // to grow the heap without causing GCs (if possible). | 14976 // to grow the heap without causing GCs (if possible). |
| 14977 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14977 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14978 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14978 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14979 "Runtime::PerformGC"); | 14979 "Runtime::PerformGC"); |
| 14980 } | 14980 } |
| 14981 } | 14981 } |
| 14982 | 14982 |
| 14983 | 14983 |
| 14984 } } // namespace v8::internal | 14984 } } // namespace v8::internal |
| OLD | NEW |