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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 DCHECK(scope_info->is_declaration_scope()); | 108 DCHECK(scope_info->is_declaration_scope()); |
109 Handle<SloppyBlockWithEvalContextExtension> result = | 109 Handle<SloppyBlockWithEvalContextExtension> result = |
110 Handle<SloppyBlockWithEvalContextExtension>::cast( | 110 Handle<SloppyBlockWithEvalContextExtension>::cast( |
111 NewStruct(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE)); | 111 NewStruct(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE)); |
112 result->set_scope_info(*scope_info); | 112 result->set_scope_info(*scope_info); |
113 result->set_extension(*extension); | 113 result->set_extension(*extension); |
114 return result; | 114 return result; |
115 } | 115 } |
116 | 116 |
117 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, | 117 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, |
118 Handle<Object> to_number, bool to_boolean, | 118 Handle<Object> to_number, |
119 const char* type_of, byte kind) { | 119 const char* type_of, byte kind) { |
120 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); | 120 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); |
121 Oddball::Initialize(isolate(), oddball, to_string, to_number, to_boolean, | 121 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind); |
122 type_of, kind); | |
123 return oddball; | 122 return oddball; |
124 } | 123 } |
125 | 124 |
126 | 125 |
127 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { | 126 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { |
128 DCHECK(0 <= size); | 127 DCHECK(0 <= size); |
129 CALL_HEAP_FUNCTION( | 128 CALL_HEAP_FUNCTION( |
130 isolate(), | 129 isolate(), |
131 isolate()->heap()->AllocateFixedArray(size, pretenure), | 130 isolate()->heap()->AllocateFixedArray(size, pretenure), |
132 FixedArray); | 131 FixedArray); |
(...skipping 2374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2507 Handle<AccessorInfo> prototype = | 2506 Handle<AccessorInfo> prototype = |
2508 Accessors::FunctionPrototypeInfo(isolate(), attribs); | 2507 Accessors::FunctionPrototypeInfo(isolate(), attribs); |
2509 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), | 2508 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), |
2510 prototype, attribs); | 2509 prototype, attribs); |
2511 map->AppendDescriptor(&d); | 2510 map->AppendDescriptor(&d); |
2512 } | 2511 } |
2513 } | 2512 } |
2514 | 2513 |
2515 } // namespace internal | 2514 } // namespace internal |
2516 } // namespace v8 | 2515 } // namespace v8 |
OLD | NEW |