OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 pretenure), | 344 pretenure), |
345 JSFunction); | 345 JSFunction); |
346 } | 346 } |
347 | 347 |
348 | 348 |
349 Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo( | 349 Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo( |
350 Handle<SharedFunctionInfo> function_info, | 350 Handle<SharedFunctionInfo> function_info, |
351 Handle<Context> context, | 351 Handle<Context> context, |
352 PretenureFlag pretenure) { | 352 PretenureFlag pretenure) { |
353 Handle<JSFunction> result = BaseNewFunctionFromSharedFunctionInfo( | 353 Handle<JSFunction> result = BaseNewFunctionFromSharedFunctionInfo( |
354 function_info, Top::function_map(), pretenure); | 354 function_info, |
| 355 function_info->strict_mode() |
| 356 ? Top::function_map_strict() |
| 357 : Top::function_map(), |
| 358 pretenure); |
| 359 |
355 result->set_context(*context); | 360 result->set_context(*context); |
356 int number_of_literals = function_info->num_literals(); | 361 int number_of_literals = function_info->num_literals(); |
357 Handle<FixedArray> literals = | 362 Handle<FixedArray> literals = |
358 Factory::NewFixedArray(number_of_literals, pretenure); | 363 Factory::NewFixedArray(number_of_literals, pretenure); |
359 if (number_of_literals > 0) { | 364 if (number_of_literals > 0) { |
360 // Store the object, regexp and array functions in the literals | 365 // Store the object, regexp and array functions in the literals |
361 // array prefix. These functions will be used when creating | 366 // array prefix. These functions will be used when creating |
362 // object, regexp and array literals in this function. | 367 // object, regexp and array literals in this function. |
363 literals->set(JSFunction::kLiteralGlobalContextIndex, | 368 literals->set(JSFunction::kLiteralGlobalContextIndex, |
364 context->global_context()); | 369 context->global_context()); |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 } | 824 } |
820 | 825 |
821 | 826 |
822 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name) { | 827 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name) { |
823 Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name); | 828 Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name); |
824 fun->set_context(Top::context()->global_context()); | 829 fun->set_context(Top::context()->global_context()); |
825 return fun; | 830 return fun; |
826 } | 831 } |
827 | 832 |
828 | 833 |
| 834 Handle<JSFunction> Factory::NewFunctionWithoutPrototypeStrictHelper( |
| 835 Handle<String> name) { |
| 836 Handle<SharedFunctionInfo> function_share = NewSharedFunctionInfo(name); |
| 837 CALL_HEAP_FUNCTION(Heap::AllocateFunction( |
| 838 *Top::function_without_prototype_map_strict(), |
| 839 *function_share, |
| 840 *the_hole_value()), |
| 841 JSFunction); |
| 842 } |
| 843 |
| 844 |
| 845 Handle<JSFunction> Factory::NewFunctionWithoutPrototypeStrict( |
| 846 Handle<String> name) { |
| 847 Handle<JSFunction> fun = NewFunctionWithoutPrototypeStrictHelper(name); |
| 848 fun->set_context(Top::context()->global_context()); |
| 849 return fun; |
| 850 } |
| 851 |
829 Handle<Object> Factory::ToObject(Handle<Object> object) { | 852 Handle<Object> Factory::ToObject(Handle<Object> object) { |
830 CALL_HEAP_FUNCTION(object->ToObject(), Object); | 853 CALL_HEAP_FUNCTION(object->ToObject(), Object); |
831 } | 854 } |
832 | 855 |
833 | 856 |
834 Handle<Object> Factory::ToObject(Handle<Object> object, | 857 Handle<Object> Factory::ToObject(Handle<Object> object, |
835 Handle<Context> global_context) { | 858 Handle<Context> global_context) { |
836 CALL_HEAP_FUNCTION(object->ToObject(*global_context), Object); | 859 CALL_HEAP_FUNCTION(object->ToObject(*global_context), Object); |
837 } | 860 } |
838 | 861 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 Execution::ConfigureInstance(instance, | 1092 Execution::ConfigureInstance(instance, |
1070 instance_template, | 1093 instance_template, |
1071 pending_exception); | 1094 pending_exception); |
1072 } else { | 1095 } else { |
1073 *pending_exception = false; | 1096 *pending_exception = false; |
1074 } | 1097 } |
1075 } | 1098 } |
1076 | 1099 |
1077 | 1100 |
1078 } } // namespace v8::internal | 1101 } } // namespace v8::internal |
OLD | NEW |