OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 Handle<String> name = InternalizeStringWithKey(&key); | 1789 Handle<String> name = InternalizeStringWithKey(&key); |
1790 shared = NewSharedFunctionInfo(name, MaybeHandle<Code>()); | 1790 shared = NewSharedFunctionInfo(name, MaybeHandle<Code>()); |
1791 } | 1791 } |
1792 | 1792 |
1793 // In order to keep heap in consistent state there must be no allocations | 1793 // In order to keep heap in consistent state there must be no allocations |
1794 // before object re-initialization is finished and filler object is installed. | 1794 // before object re-initialization is finished and filler object is installed. |
1795 DisallowHeapAllocation no_allocation; | 1795 DisallowHeapAllocation no_allocation; |
1796 | 1796 |
1797 // Put in filler if the new object is smaller than the old. | 1797 // Put in filler if the new object is smaller than the old. |
1798 if (size_difference > 0) { | 1798 if (size_difference > 0) { |
1799 Address address = object->address() + map->instance_size(); | 1799 Address address = object->address(); |
1800 heap->CreateFillerObjectAt(address, size_difference); | 1800 heap->CreateFillerObjectAt(address + map->instance_size(), size_difference); |
1801 heap->AdjustLiveBytes(address, -size_difference, Heap::FROM_MUTATOR); | 1801 heap->AdjustLiveBytes(address, -size_difference, Heap::FROM_MUTATOR); |
1802 } | 1802 } |
1803 | 1803 |
1804 // Reset the map for the object. | 1804 // Reset the map for the object. |
1805 object->synchronized_set_map(*map); | 1805 object->synchronized_set_map(*map); |
1806 Handle<JSObject> jsobj = Handle<JSObject>::cast(object); | 1806 Handle<JSObject> jsobj = Handle<JSObject>::cast(object); |
1807 | 1807 |
1808 // Reinitialize the object from the constructor map. | 1808 // Reinitialize the object from the constructor map. |
1809 heap->InitializeJSObjectFromMap(*jsobj, *properties, *map); | 1809 heap->InitializeJSObjectFromMap(*jsobj, *properties, *map); |
1810 | 1810 |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2365 return Handle<Object>::null(); | 2365 return Handle<Object>::null(); |
2366 } | 2366 } |
2367 | 2367 |
2368 | 2368 |
2369 Handle<Object> Factory::ToBoolean(bool value) { | 2369 Handle<Object> Factory::ToBoolean(bool value) { |
2370 return value ? true_value() : false_value(); | 2370 return value ? true_value() : false_value(); |
2371 } | 2371 } |
2372 | 2372 |
2373 | 2373 |
2374 } } // namespace v8::internal | 2374 } } // namespace v8::internal |
OLD | NEW |