Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 3c76e5467c970b410371f1b03802909b2556b292..2b213e85adc7b1b4b4869f2b390c2c4e5c65371d 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -830,10 +830,14 @@ Handle<PropertyCell> Factory::NewPropertyCell(Handle<Object> value) { |
Handle<AllocationSite> Factory::NewAllocationSite() { |
- CALL_HEAP_FUNCTION( |
- isolate(), |
- isolate()->heap()->AllocateAllocationSite(), |
- AllocationSite); |
+ Handle<Map> map = allocation_site_map(); |
+ Handle<AllocationSite> site = New<AllocationSite>(map, OLD_POINTER_SPACE); |
+ site->Initialize(); |
+ |
+ // Link the site |
+ site->set_weak_next(isolate()->heap()->allocation_sites_list()); |
+ isolate()->heap()->set_allocation_sites_list(*site); |
+ return site; |
} |