OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 3108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3119 AllocationResult Heap::AllocateWeakCell(HeapObject* value) { | 3119 AllocationResult Heap::AllocateWeakCell(HeapObject* value) { |
3120 int size = WeakCell::kSize; | 3120 int size = WeakCell::kSize; |
3121 STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize); | 3121 STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize); |
3122 HeapObject* result = NULL; | 3122 HeapObject* result = NULL; |
3123 { | 3123 { |
3124 AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE); | 3124 AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE); |
3125 if (!allocation.To(&result)) return allocation; | 3125 if (!allocation.To(&result)) return allocation; |
3126 } | 3126 } |
3127 result->set_map_no_write_barrier(weak_cell_map()); | 3127 result->set_map_no_write_barrier(weak_cell_map()); |
3128 WeakCell::cast(result)->initialize(value); | 3128 WeakCell::cast(result)->initialize(value); |
3129 WeakCell::cast(result)->set_next(the_hole_value(), SKIP_WRITE_BARRIER); | 3129 WeakCell::cast(result)->clear_next(this); |
3130 return result; | 3130 return result; |
3131 } | 3131 } |
3132 | 3132 |
3133 | 3133 |
3134 void Heap::CreateApiObjects() { | 3134 void Heap::CreateApiObjects() { |
3135 HandleScope scope(isolate()); | 3135 HandleScope scope(isolate()); |
3136 Factory* factory = isolate()->factory(); | 3136 Factory* factory = isolate()->factory(); |
3137 Handle<Map> new_neander_map = | 3137 Handle<Map> new_neander_map = |
3138 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 3138 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
3139 | 3139 |
(...skipping 3692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6832 *object_type = "CODE_TYPE"; \ | 6832 *object_type = "CODE_TYPE"; \ |
6833 *object_sub_type = "CODE_AGE/" #name; \ | 6833 *object_sub_type = "CODE_AGE/" #name; \ |
6834 return true; | 6834 return true; |
6835 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6835 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6836 #undef COMPARE_AND_RETURN_NAME | 6836 #undef COMPARE_AND_RETURN_NAME |
6837 } | 6837 } |
6838 return false; | 6838 return false; |
6839 } | 6839 } |
6840 } // namespace internal | 6840 } // namespace internal |
6841 } // namespace v8 | 6841 } // namespace v8 |
OLD | NEW |