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 "factory.h" | 5 #include "factory.h" |
6 | 6 |
7 #include "macro-assembler.h" | 7 #include "macro-assembler.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "v8conversions.h" | 9 #include "v8conversions.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 Handle<T> Factory::New(Handle<Map> map, | 25 Handle<T> Factory::New(Handle<Map> map, |
26 AllocationSpace space, | 26 AllocationSpace space, |
27 Handle<AllocationSite> allocation_site) { | 27 Handle<AllocationSite> allocation_site) { |
28 CALL_HEAP_FUNCTION( | 28 CALL_HEAP_FUNCTION( |
29 isolate(), | 29 isolate(), |
30 isolate()->heap()->Allocate(*map, space, *allocation_site), | 30 isolate()->heap()->Allocate(*map, space, *allocation_site), |
31 T); | 31 T); |
32 } | 32 } |
33 | 33 |
34 | 34 |
| 35 Handle<HeapObject> Factory::NewFillerObject(int size, |
| 36 bool double_align, |
| 37 AllocationSpace space) { |
| 38 CALL_HEAP_FUNCTION( |
| 39 isolate(), |
| 40 isolate()->heap()->AllocateFillerObject(size, double_align, space), |
| 41 HeapObject); |
| 42 } |
| 43 |
| 44 |
35 Handle<Box> Factory::NewBox(Handle<Object> value) { | 45 Handle<Box> Factory::NewBox(Handle<Object> value) { |
36 Handle<Box> result = Handle<Box>::cast(NewStruct(BOX_TYPE)); | 46 Handle<Box> result = Handle<Box>::cast(NewStruct(BOX_TYPE)); |
37 result->set_value(*value); | 47 result->set_value(*value); |
38 return result; | 48 return result; |
39 } | 49 } |
40 | 50 |
41 | 51 |
42 Handle<Oddball> Factory::NewOddball(Handle<Map> map, | 52 Handle<Oddball> Factory::NewOddball(Handle<Map> map, |
43 const char* to_string, | 53 const char* to_string, |
44 Handle<Object> to_number, | 54 Handle<Object> to_number, |
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2330 if (String::Equals(name, infinity_string())) return infinity_value(); | 2340 if (String::Equals(name, infinity_string())) return infinity_value(); |
2331 return Handle<Object>::null(); | 2341 return Handle<Object>::null(); |
2332 } | 2342 } |
2333 | 2343 |
2334 | 2344 |
2335 Handle<Object> Factory::ToBoolean(bool value) { | 2345 Handle<Object> Factory::ToBoolean(bool value) { |
2336 return value ? true_value() : false_value(); | 2346 return value ? true_value() : false_value(); |
2337 } | 2347 } |
2338 | 2348 |
2339 } } // namespace v8::internal | 2349 } } // namespace v8::internal |
OLD | NEW |