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 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1613 if (FLAG_harmony_observation && obj->map()->is_observed()) { | 1613 if (FLAG_harmony_observation && obj->map()->is_observed()) { |
1614 Handle<Object> old_value( | 1614 Handle<Object> old_value( |
1615 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); | 1615 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); |
1616 | 1616 |
1617 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); | 1617 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); |
1618 RETURN_IF_EMPTY_HANDLE(isolate, result); | 1618 RETURN_IF_EMPTY_HANDLE(isolate, result); |
1619 | 1619 |
1620 Handle<Object> new_value( | 1620 Handle<Object> new_value( |
1621 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); | 1621 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); |
1622 if (!new_value->SameValue(*old_value)) { | 1622 if (!new_value->SameValue(*old_value)) { |
1623 JSObject::EnqueueChangeRecord(obj, "prototype", | 1623 JSObject::EnqueueChangeRecord(obj, "setPrototype", |
1624 isolate->factory()->proto_string(), | 1624 isolate->factory()->proto_string(), |
1625 old_value); | 1625 old_value); |
1626 } | 1626 } |
1627 return *result; | 1627 return *result; |
1628 } | 1628 } |
1629 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); | 1629 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); |
1630 RETURN_IF_EMPTY_HANDLE(isolate, result); | 1630 RETURN_IF_EMPTY_HANDLE(isolate, result); |
1631 return *result; | 1631 return *result; |
1632 } | 1632 } |
1633 | 1633 |
(...skipping 13204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14838 // Handle last resort GC and make sure to allow future allocations | 14838 // Handle last resort GC and make sure to allow future allocations |
14839 // to grow the heap without causing GCs (if possible). | 14839 // to grow the heap without causing GCs (if possible). |
14840 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14840 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14841 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14841 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14842 "Runtime::PerformGC"); | 14842 "Runtime::PerformGC"); |
14843 } | 14843 } |
14844 } | 14844 } |
14845 | 14845 |
14846 | 14846 |
14847 } } // namespace v8::internal | 14847 } } // namespace v8::internal |
OLD | NEW |