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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 Handle<PrototypeInfo> result = | 55 Handle<PrototypeInfo> result = |
56 Handle<PrototypeInfo>::cast(NewStruct(PROTOTYPE_INFO_TYPE)); | 56 Handle<PrototypeInfo>::cast(NewStruct(PROTOTYPE_INFO_TYPE)); |
57 result->set_prototype_users(WeakFixedArray::Empty()); | 57 result->set_prototype_users(WeakFixedArray::Empty()); |
58 result->set_registry_slot(PrototypeInfo::UNREGISTERED); | 58 result->set_registry_slot(PrototypeInfo::UNREGISTERED); |
59 result->set_validity_cell(Smi::FromInt(0)); | 59 result->set_validity_cell(Smi::FromInt(0)); |
60 result->set_constructor_name(Smi::FromInt(0)); | 60 result->set_constructor_name(Smi::FromInt(0)); |
61 return result; | 61 return result; |
62 } | 62 } |
63 | 63 |
64 | 64 |
| 65 Handle<SloppyBlockWithEvalContextExtension> |
| 66 Factory::NewSloppyBlockWithEvalContextExtension( |
| 67 Handle<ScopeInfo> scope_info, Handle<JSObject> extension) { |
| 68 Handle<SloppyBlockWithEvalContextExtension> result = |
| 69 Handle<SloppyBlockWithEvalContextExtension>::cast( |
| 70 NewStruct(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE)); |
| 71 result->set_scope_info(*scope_info); |
| 72 result->set_extension(*extension); |
| 73 return result; |
| 74 } |
| 75 |
| 76 |
65 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, | 77 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, |
66 Handle<Object> to_number, | 78 Handle<Object> to_number, |
67 const char* type_of, byte kind) { | 79 const char* type_of, byte kind) { |
68 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); | 80 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); |
69 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind); | 81 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind); |
70 return oddball; | 82 return oddball; |
71 } | 83 } |
72 | 84 |
73 | 85 |
74 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { | 86 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { |
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2354 } | 2366 } |
2355 | 2367 |
2356 | 2368 |
2357 Handle<Object> Factory::ToBoolean(bool value) { | 2369 Handle<Object> Factory::ToBoolean(bool value) { |
2358 return value ? true_value() : false_value(); | 2370 return value ? true_value() : false_value(); |
2359 } | 2371 } |
2360 | 2372 |
2361 | 2373 |
2362 } // namespace internal | 2374 } // namespace internal |
2363 } // namespace v8 | 2375 } // namespace v8 |
OLD | NEW |