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/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 Handle<ContextExtension> Factory::NewContextExtension( | 123 Handle<ContextExtension> Factory::NewContextExtension( |
124 Handle<ScopeInfo> scope_info, Handle<Object> extension) { | 124 Handle<ScopeInfo> scope_info, Handle<Object> extension) { |
125 Handle<ContextExtension> result = | 125 Handle<ContextExtension> result = |
126 Handle<ContextExtension>::cast(NewStruct(CONTEXT_EXTENSION_TYPE)); | 126 Handle<ContextExtension>::cast(NewStruct(CONTEXT_EXTENSION_TYPE)); |
127 result->set_scope_info(*scope_info); | 127 result->set_scope_info(*scope_info); |
128 result->set_extension(*extension); | 128 result->set_extension(*extension); |
129 return result; | 129 return result; |
130 } | 130 } |
131 | 131 |
| 132 Handle<ConstantElementsPair> Factory::NewConstantElementsPair( |
| 133 ElementsKind elements_kind, Handle<FixedArrayBase> constant_values) { |
| 134 Handle<ConstantElementsPair> result = Handle<ConstantElementsPair>::cast( |
| 135 NewStruct(CONSTANT_ELEMENTS_PAIR_TYPE)); |
| 136 result->set_elements_kind(elements_kind); |
| 137 result->set_constant_values(*constant_values); |
| 138 return result; |
| 139 } |
| 140 |
132 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, | 141 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, |
133 Handle<Object> to_number, | 142 Handle<Object> to_number, |
134 const char* type_of, byte kind) { | 143 const char* type_of, byte kind) { |
135 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); | 144 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); |
136 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind); | 145 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind); |
137 return oddball; | 146 return oddball; |
138 } | 147 } |
139 | 148 |
140 | 149 |
141 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { | 150 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { |
(...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2759 Handle<AccessorInfo> prototype = | 2768 Handle<AccessorInfo> prototype = |
2760 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); | 2769 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); |
2761 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), | 2770 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), |
2762 prototype, rw_attribs); | 2771 prototype, rw_attribs); |
2763 map->AppendDescriptor(&d); | 2772 map->AppendDescriptor(&d); |
2764 } | 2773 } |
2765 } | 2774 } |
2766 | 2775 |
2767 } // namespace internal | 2776 } // namespace internal |
2768 } // namespace v8 | 2777 } // namespace v8 |
OLD | NEW |