| 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/conversions.h" | 9 #include "src/conversions.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 Handle<SharedFunctionInfo> info, | 1230 Handle<SharedFunctionInfo> info, |
| 1231 Handle<Context> context) { | 1231 Handle<Context> context) { |
| 1232 function->initialize_properties(); | 1232 function->initialize_properties(); |
| 1233 function->initialize_elements(); | 1233 function->initialize_elements(); |
| 1234 function->set_shared(*info); | 1234 function->set_shared(*info); |
| 1235 function->set_code(info->code()); | 1235 function->set_code(info->code()); |
| 1236 function->set_context(*context); | 1236 function->set_context(*context); |
| 1237 function->set_prototype_or_initial_map(*the_hole_value()); | 1237 function->set_prototype_or_initial_map(*the_hole_value()); |
| 1238 function->set_literals_or_bindings(*empty_fixed_array()); | 1238 function->set_literals_or_bindings(*empty_fixed_array()); |
| 1239 function->set_next_function_link(*undefined_value()); | 1239 function->set_next_function_link(*undefined_value()); |
| 1240 | |
| 1241 // TODO(arv): This does not look correct. We need to make sure we use | |
| 1242 // a Map that has no prototype property. | |
| 1243 if (info->is_arrow()) function->RemovePrototype(); | |
| 1244 } | 1240 } |
| 1245 | 1241 |
| 1246 | 1242 |
| 1247 Handle<JSFunction> Factory::NewFunction(Handle<Map> map, | 1243 Handle<JSFunction> Factory::NewFunction(Handle<Map> map, |
| 1248 Handle<SharedFunctionInfo> info, | 1244 Handle<SharedFunctionInfo> info, |
| 1249 Handle<Context> context, | 1245 Handle<Context> context, |
| 1250 PretenureFlag pretenure) { | 1246 PretenureFlag pretenure) { |
| 1251 AllocationSpace space = pretenure == TENURED ? OLD_POINTER_SPACE : NEW_SPACE; | 1247 AllocationSpace space = pretenure == TENURED ? OLD_POINTER_SPACE : NEW_SPACE; |
| 1252 Handle<JSFunction> result = New<JSFunction>(map, space); | 1248 Handle<JSFunction> result = New<JSFunction>(map, space); |
| 1253 InitializeFunction(result, info, context); | 1249 InitializeFunction(result, info, context); |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2395 return Handle<Object>::null(); | 2391 return Handle<Object>::null(); |
| 2396 } | 2392 } |
| 2397 | 2393 |
| 2398 | 2394 |
| 2399 Handle<Object> Factory::ToBoolean(bool value) { | 2395 Handle<Object> Factory::ToBoolean(bool value) { |
| 2400 return value ? true_value() : false_value(); | 2396 return value ? true_value() : false_value(); |
| 2401 } | 2397 } |
| 2402 | 2398 |
| 2403 | 2399 |
| 2404 } } // namespace v8::internal | 2400 } } // namespace v8::internal |
| OLD | NEW |