| 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 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 } | 1642 } |
| 1643 return current; | 1643 return current; |
| 1644 } | 1644 } |
| 1645 | 1645 |
| 1646 | 1646 |
| 1647 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) { | 1647 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) { |
| 1648 HandleScope scope(isolate); | 1648 HandleScope scope(isolate); |
| 1649 ASSERT(args.length() == 2); | 1649 ASSERT(args.length() == 2); |
| 1650 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 1650 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
| 1651 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 1651 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
| 1652 if (obj->map()->is_observed()) { | 1652 if (FLAG_harmony_observation && obj->map()->is_observed()) { |
| 1653 Handle<Object> old_value( | 1653 Handle<Object> old_value( |
| 1654 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); | 1654 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); |
| 1655 | 1655 |
| 1656 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); | 1656 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); |
| 1657 RETURN_IF_EMPTY_HANDLE(isolate, result); | 1657 RETURN_IF_EMPTY_HANDLE(isolate, result); |
| 1658 | 1658 |
| 1659 Handle<Object> new_value( | 1659 Handle<Object> new_value( |
| 1660 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); | 1660 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); |
| 1661 if (!new_value->SameValue(*old_value)) { | 1661 if (!new_value->SameValue(*old_value)) { |
| 1662 JSObject::EnqueueChangeRecord(obj, "setPrototype", | 1662 JSObject::EnqueueChangeRecord(obj, "setPrototype", |
| (...skipping 13304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14967 // Handle last resort GC and make sure to allow future allocations | 14967 // Handle last resort GC and make sure to allow future allocations |
| 14968 // to grow the heap without causing GCs (if possible). | 14968 // to grow the heap without causing GCs (if possible). |
| 14969 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14969 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14970 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14970 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14971 "Runtime::PerformGC"); | 14971 "Runtime::PerformGC"); |
| 14972 } | 14972 } |
| 14973 } | 14973 } |
| 14974 | 14974 |
| 14975 | 14975 |
| 14976 } } // namespace v8::internal | 14976 } } // namespace v8::internal |
| OLD | NEW |