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, | 354 function_info, Top::function_map(), pretenure); |
355 function_info->strict_mode() | |
356 ? Top::function_map_strict() | |
357 : Top::function_map(), | |
358 pretenure); | |
359 | |
360 result->set_context(*context); | 355 result->set_context(*context); |
361 int number_of_literals = function_info->num_literals(); | 356 int number_of_literals = function_info->num_literals(); |
362 Handle<FixedArray> literals = | 357 Handle<FixedArray> literals = |
363 Factory::NewFixedArray(number_of_literals, pretenure); | 358 Factory::NewFixedArray(number_of_literals, pretenure); |
364 if (number_of_literals > 0) { | 359 if (number_of_literals > 0) { |
365 // Store the object, regexp and array functions in the literals | 360 // Store the object, regexp and array functions in the literals |
366 // array prefix. These functions will be used when creating | 361 // array prefix. These functions will be used when creating |
367 // object, regexp and array literals in this function. | 362 // object, regexp and array literals in this function. |
368 literals->set(JSFunction::kLiteralGlobalContextIndex, | 363 literals->set(JSFunction::kLiteralGlobalContextIndex, |
369 context->global_context()); | 364 context->global_context()); |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 } | 819 } |
825 | 820 |
826 | 821 |
827 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name) { | 822 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name) { |
828 Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name); | 823 Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name); |
829 fun->set_context(Top::context()->global_context()); | 824 fun->set_context(Top::context()->global_context()); |
830 return fun; | 825 return fun; |
831 } | 826 } |
832 | 827 |
833 | 828 |
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 | |
852 Handle<Object> Factory::ToObject(Handle<Object> object) { | 829 Handle<Object> Factory::ToObject(Handle<Object> object) { |
853 CALL_HEAP_FUNCTION(object->ToObject(), Object); | 830 CALL_HEAP_FUNCTION(object->ToObject(), Object); |
854 } | 831 } |
855 | 832 |
856 | 833 |
857 Handle<Object> Factory::ToObject(Handle<Object> object, | 834 Handle<Object> Factory::ToObject(Handle<Object> object, |
858 Handle<Context> global_context) { | 835 Handle<Context> global_context) { |
859 CALL_HEAP_FUNCTION(object->ToObject(*global_context), Object); | 836 CALL_HEAP_FUNCTION(object->ToObject(*global_context), Object); |
860 } | 837 } |
861 | 838 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 Execution::ConfigureInstance(instance, | 1069 Execution::ConfigureInstance(instance, |
1093 instance_template, | 1070 instance_template, |
1094 pending_exception); | 1071 pending_exception); |
1095 } else { | 1072 } else { |
1096 *pending_exception = false; | 1073 *pending_exception = false; |
1097 } | 1074 } |
1098 } | 1075 } |
1099 | 1076 |
1100 | 1077 |
1101 } } // namespace v8::internal | 1078 } } // namespace v8::internal |
OLD | NEW |