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 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 void Factory::InitializeFunction(Handle<JSFunction> function, | 1250 void Factory::InitializeFunction(Handle<JSFunction> function, |
1251 Handle<SharedFunctionInfo> info, | 1251 Handle<SharedFunctionInfo> info, |
1252 Handle<Context> context) { | 1252 Handle<Context> context) { |
1253 function->initialize_properties(); | 1253 function->initialize_properties(); |
1254 function->initialize_elements(); | 1254 function->initialize_elements(); |
1255 function->set_shared(*info); | 1255 function->set_shared(*info); |
1256 function->set_code(info->code()); | 1256 function->set_code(info->code()); |
1257 function->set_context(*context); | 1257 function->set_context(*context); |
1258 function->set_prototype_or_initial_map(*the_hole_value()); | 1258 function->set_prototype_or_initial_map(*the_hole_value()); |
1259 function->set_literals_or_bindings(*empty_fixed_array()); | 1259 function->set_literals_or_bindings(*empty_fixed_array()); |
1260 function->set_next_function_link(*undefined_value()); | 1260 function->set_next_function_link(*undefined_value(), SKIP_WRITE_BARRIER); |
1261 } | 1261 } |
1262 | 1262 |
1263 | 1263 |
1264 Handle<JSFunction> Factory::NewFunction(Handle<Map> map, | 1264 Handle<JSFunction> Factory::NewFunction(Handle<Map> map, |
1265 Handle<SharedFunctionInfo> info, | 1265 Handle<SharedFunctionInfo> info, |
1266 Handle<Context> context, | 1266 Handle<Context> context, |
1267 PretenureFlag pretenure) { | 1267 PretenureFlag pretenure) { |
1268 AllocationSpace space = pretenure == TENURED ? OLD_SPACE : NEW_SPACE; | 1268 AllocationSpace space = pretenure == TENURED ? OLD_SPACE : NEW_SPACE; |
1269 Handle<JSFunction> result = New<JSFunction>(map, space); | 1269 Handle<JSFunction> result = New<JSFunction>(map, space); |
1270 InitializeFunction(result, info, context); | 1270 InitializeFunction(result, info, context); |
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2464 return Handle<Object>::null(); | 2464 return Handle<Object>::null(); |
2465 } | 2465 } |
2466 | 2466 |
2467 | 2467 |
2468 Handle<Object> Factory::ToBoolean(bool value) { | 2468 Handle<Object> Factory::ToBoolean(bool value) { |
2469 return value ? true_value() : false_value(); | 2469 return value ? true_value() : false_value(); |
2470 } | 2470 } |
2471 | 2471 |
2472 | 2472 |
2473 } } // namespace v8::internal | 2473 } } // namespace v8::internal |
OLD | NEW |