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/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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 Handle<Box> Factory::NewBox(Handle<Object> value) { | 47 Handle<Box> Factory::NewBox(Handle<Object> value) { |
48 Handle<Box> result = Handle<Box>::cast(NewStruct(BOX_TYPE)); | 48 Handle<Box> result = Handle<Box>::cast(NewStruct(BOX_TYPE)); |
49 result->set_value(*value); | 49 result->set_value(*value); |
50 return result; | 50 return result; |
51 } | 51 } |
52 | 52 |
53 | 53 |
54 Handle<PrototypeInfo> Factory::NewPrototypeInfo( | |
55 Handle<JSObject> prototype_obj) { | |
56 Handle<PrototypeInfo> result = | |
57 Handle<PrototypeInfo>::cast(NewStruct(PROTOTYPE_INFO_TYPE)); | |
58 result->set_prototype_object(*prototype_obj); | |
59 result->set_prototype_users(Smi::FromInt(0)); | |
Toon Verwaest
2015/03/26 16:15:33
Something like WeakFixedArray::Empty() perhaps?
Jakob Kummerow
2015/03/31 14:20:21
Done.
| |
60 result->set_validity_cell(Smi::FromInt(0)); | |
61 return result; | |
62 } | |
63 | |
64 | |
54 Handle<Oddball> Factory::NewOddball(Handle<Map> map, | 65 Handle<Oddball> Factory::NewOddball(Handle<Map> map, |
55 const char* to_string, | 66 const char* to_string, |
56 Handle<Object> to_number, | 67 Handle<Object> to_number, |
57 byte kind) { | 68 byte kind) { |
58 Handle<Oddball> oddball = New<Oddball>(map, OLD_POINTER_SPACE); | 69 Handle<Oddball> oddball = New<Oddball>(map, OLD_POINTER_SPACE); |
59 Oddball::Initialize(isolate(), oddball, to_string, to_number, kind); | 70 Oddball::Initialize(isolate(), oddball, to_string, to_number, kind); |
60 return oddball; | 71 return oddball; |
61 } | 72 } |
62 | 73 |
63 | 74 |
(...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2321 return Handle<Object>::null(); | 2332 return Handle<Object>::null(); |
2322 } | 2333 } |
2323 | 2334 |
2324 | 2335 |
2325 Handle<Object> Factory::ToBoolean(bool value) { | 2336 Handle<Object> Factory::ToBoolean(bool value) { |
2326 return value ? true_value() : false_value(); | 2337 return value ? true_value() : false_value(); |
2327 } | 2338 } |
2328 | 2339 |
2329 | 2340 |
2330 } } // namespace v8::internal | 2341 } } // namespace v8::internal |
OLD | NEW |