Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1059)

Side by Side Diff: src/factory.cc

Issue 640303006: Weak Cells (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Skip cleared weak cells Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 924
925 925
926 Handle<PropertyCell> Factory::NewPropertyCell(Handle<Object> value) { 926 Handle<PropertyCell> Factory::NewPropertyCell(Handle<Object> value) {
927 AllowDeferredHandleDereference convert_to_cell; 927 AllowDeferredHandleDereference convert_to_cell;
928 Handle<PropertyCell> cell = NewPropertyCellWithHole(); 928 Handle<PropertyCell> cell = NewPropertyCellWithHole();
929 PropertyCell::SetValueInferType(cell, value); 929 PropertyCell::SetValueInferType(cell, value);
930 return cell; 930 return cell;
931 } 931 }
932 932
933 933
934 Handle<WeakCell> Factory::NewWeakCell(Handle<HeapObject> value) {
935 AllowDeferredHandleDereference convert_to_cell;
936 CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateWeakCell(*value),
937 WeakCell);
938 }
939
940
934 Handle<AllocationSite> Factory::NewAllocationSite() { 941 Handle<AllocationSite> Factory::NewAllocationSite() {
935 Handle<Map> map = allocation_site_map(); 942 Handle<Map> map = allocation_site_map();
936 Handle<AllocationSite> site = New<AllocationSite>(map, OLD_POINTER_SPACE); 943 Handle<AllocationSite> site = New<AllocationSite>(map, OLD_POINTER_SPACE);
937 site->Initialize(); 944 site->Initialize();
938 945
939 // Link the site 946 // Link the site
940 site->set_weak_next(isolate()->heap()->allocation_sites_list()); 947 site->set_weak_next(isolate()->heap()->allocation_sites_list());
941 isolate()->heap()->set_allocation_sites_list(*site); 948 isolate()->heap()->set_allocation_sites_list(*site);
942 return site; 949 return site;
943 } 950 }
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2451 return Handle<Object>::null(); 2458 return Handle<Object>::null();
2452 } 2459 }
2453 2460
2454 2461
2455 Handle<Object> Factory::ToBoolean(bool value) { 2462 Handle<Object> Factory::ToBoolean(bool value) {
2456 return value ? true_value() : false_value(); 2463 return value ? true_value() : false_value();
2457 } 2464 }
2458 2465
2459 2466
2460 } } // namespace v8::internal 2467 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698