| 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 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 } | 1661 } |
| 1662 return current; | 1662 return current; |
| 1663 } | 1663 } |
| 1664 | 1664 |
| 1665 | 1665 |
| 1666 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) { | 1666 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) { |
| 1667 HandleScope scope(isolate); | 1667 HandleScope scope(isolate); |
| 1668 ASSERT(args.length() == 2); | 1668 ASSERT(args.length() == 2); |
| 1669 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 1669 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
| 1670 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 1670 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
| 1671 if (obj->IsAccessCheckNeeded() && |
| 1672 !isolate->MayNamedAccessWrapper(obj, |
| 1673 isolate->factory()->proto_string(), |
| 1674 v8::ACCESS_SET)) { |
| 1675 isolate->ReportFailedAccessCheck(*obj, v8::ACCESS_SET); |
| 1676 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 1677 return isolate->heap()->undefined_value(); |
| 1678 } |
| 1671 if (FLAG_harmony_observation && obj->map()->is_observed()) { | 1679 if (FLAG_harmony_observation && obj->map()->is_observed()) { |
| 1672 Handle<Object> old_value( | 1680 Handle<Object> old_value( |
| 1673 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); | 1681 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); |
| 1674 | 1682 |
| 1675 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); | 1683 Handle<Object> result = JSObject::SetPrototype(obj, prototype, true); |
| 1676 RETURN_IF_EMPTY_HANDLE(isolate, result); | 1684 RETURN_IF_EMPTY_HANDLE(isolate, result); |
| 1677 | 1685 |
| 1678 Handle<Object> new_value( | 1686 Handle<Object> new_value( |
| 1679 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); | 1687 GetPrototypeSkipHiddenPrototypes(isolate, *obj), isolate); |
| 1680 if (!new_value->SameValue(*old_value)) { | 1688 if (!new_value->SameValue(*old_value)) { |
| (...skipping 13248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14929 // Handle last resort GC and make sure to allow future allocations | 14937 // Handle last resort GC and make sure to allow future allocations |
| 14930 // to grow the heap without causing GCs (if possible). | 14938 // to grow the heap without causing GCs (if possible). |
| 14931 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14939 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14932 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14940 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14933 "Runtime::PerformGC"); | 14941 "Runtime::PerformGC"); |
| 14934 } | 14942 } |
| 14935 } | 14943 } |
| 14936 | 14944 |
| 14937 | 14945 |
| 14938 } } // namespace v8::internal | 14946 } } // namespace v8::internal |
| OLD | NEW |