OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 Object* initial_map = AllocateInitialMap(constructor); | 1757 Object* initial_map = AllocateInitialMap(constructor); |
1758 if (initial_map->IsFailure()) return initial_map; | 1758 if (initial_map->IsFailure()) return initial_map; |
1759 constructor->set_initial_map(Map::cast(initial_map)); | 1759 constructor->set_initial_map(Map::cast(initial_map)); |
1760 Map::cast(initial_map)->set_constructor(constructor); | 1760 Map::cast(initial_map)->set_constructor(constructor); |
1761 } | 1761 } |
1762 // Allocate the object based on the constructors initial map. | 1762 // Allocate the object based on the constructors initial map. |
1763 return AllocateJSObjectFromMap(constructor->initial_map(), pretenure); | 1763 return AllocateJSObjectFromMap(constructor->initial_map(), pretenure); |
1764 } | 1764 } |
1765 | 1765 |
1766 | 1766 |
1767 Object* Heap::ReinitializeJSGlobalObject(JSFunction* constructor, | 1767 Object* Heap::ReinitializeJSGlobalProxy(JSFunction* constructor, |
1768 JSGlobalObject* object) { | 1768 JSGlobalProxy* object) { |
1769 // Allocate initial map if absent. | 1769 // Allocate initial map if absent. |
1770 if (!constructor->has_initial_map()) { | 1770 if (!constructor->has_initial_map()) { |
1771 Object* initial_map = AllocateInitialMap(constructor); | 1771 Object* initial_map = AllocateInitialMap(constructor); |
1772 if (initial_map->IsFailure()) return initial_map; | 1772 if (initial_map->IsFailure()) return initial_map; |
1773 constructor->set_initial_map(Map::cast(initial_map)); | 1773 constructor->set_initial_map(Map::cast(initial_map)); |
1774 Map::cast(initial_map)->set_constructor(constructor); | 1774 Map::cast(initial_map)->set_constructor(constructor); |
1775 } | 1775 } |
1776 | 1776 |
1777 Map* map = constructor->initial_map(); | 1777 Map* map = constructor->initial_map(); |
1778 | 1778 |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3128 #ifdef DEBUG | 3128 #ifdef DEBUG |
3129 bool Heap::GarbageCollectionGreedyCheck() { | 3129 bool Heap::GarbageCollectionGreedyCheck() { |
3130 ASSERT(FLAG_gc_greedy); | 3130 ASSERT(FLAG_gc_greedy); |
3131 if (Bootstrapper::IsActive()) return true; | 3131 if (Bootstrapper::IsActive()) return true; |
3132 if (disallow_allocation_failure()) return true; | 3132 if (disallow_allocation_failure()) return true; |
3133 return CollectGarbage(0, NEW_SPACE); | 3133 return CollectGarbage(0, NEW_SPACE); |
3134 } | 3134 } |
3135 #endif | 3135 #endif |
3136 | 3136 |
3137 } } // namespace v8::internal | 3137 } } // namespace v8::internal |
OLD | NEW |