| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 Handle<Map> Factory::GetFastElementsMap(Handle<Map> src) { | 327 Handle<Map> Factory::GetFastElementsMap(Handle<Map> src) { |
| 328 CALL_HEAP_FUNCTION(src->GetFastElementsMap(), Map); | 328 CALL_HEAP_FUNCTION(src->GetFastElementsMap(), Map); |
| 329 } | 329 } |
| 330 | 330 |
| 331 | 331 |
| 332 Handle<Map> Factory::GetSlowElementsMap(Handle<Map> src) { | 332 Handle<Map> Factory::GetSlowElementsMap(Handle<Map> src) { |
| 333 CALL_HEAP_FUNCTION(src->GetSlowElementsMap(), Map); | 333 CALL_HEAP_FUNCTION(src->GetSlowElementsMap(), Map); |
| 334 } | 334 } |
| 335 | 335 |
| 336 | 336 |
| 337 Handle<Map> Factory::GetPixelArrayElementsMap(Handle<Map> src) { |
| 338 CALL_HEAP_FUNCTION(src->GetPixelArrayElementsMap(), Map); |
| 339 } |
| 340 |
| 341 |
| 337 Handle<FixedArray> Factory::CopyFixedArray(Handle<FixedArray> array) { | 342 Handle<FixedArray> Factory::CopyFixedArray(Handle<FixedArray> array) { |
| 338 CALL_HEAP_FUNCTION(array->Copy(), FixedArray); | 343 CALL_HEAP_FUNCTION(array->Copy(), FixedArray); |
| 339 } | 344 } |
| 340 | 345 |
| 341 | 346 |
| 342 Handle<JSFunction> Factory::BaseNewFunctionFromSharedFunctionInfo( | 347 Handle<JSFunction> Factory::BaseNewFunctionFromSharedFunctionInfo( |
| 343 Handle<SharedFunctionInfo> function_info, | 348 Handle<SharedFunctionInfo> function_info, |
| 344 Handle<Map> function_map, | 349 Handle<Map> function_map, |
| 345 PretenureFlag pretenure) { | 350 PretenureFlag pretenure) { |
| 346 CALL_HEAP_FUNCTION(Heap::AllocateFunction(*function_map, | 351 CALL_HEAP_FUNCTION(Heap::AllocateFunction(*function_map, |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 type != JS_OBJECT_TYPE || | 578 type != JS_OBJECT_TYPE || |
| 574 instance_size != JSObject::kHeaderSize) { | 579 instance_size != JSObject::kHeaderSize) { |
| 575 Handle<Map> initial_map = NewMap(type, instance_size); | 580 Handle<Map> initial_map = NewMap(type, instance_size); |
| 576 function->set_initial_map(*initial_map); | 581 function->set_initial_map(*initial_map); |
| 577 initial_map->set_constructor(*function); | 582 initial_map->set_constructor(*function); |
| 578 } | 583 } |
| 579 | 584 |
| 580 // Set function.prototype and give the prototype a constructor | 585 // Set function.prototype and give the prototype a constructor |
| 581 // property that refers to the function. | 586 // property that refers to the function. |
| 582 SetPrototypeProperty(function, prototype); | 587 SetPrototypeProperty(function, prototype); |
| 583 SetProperty(prototype, Factory::constructor_symbol(), function, DONT_ENUM); | 588 // Currently safe because it is only invoked from Genesis. |
| 589 SetLocalPropertyNoThrow( |
| 590 prototype, Factory::constructor_symbol(), function, DONT_ENUM); |
| 584 return function; | 591 return function; |
| 585 } | 592 } |
| 586 | 593 |
| 587 | 594 |
| 588 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, | 595 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, |
| 589 Handle<Code> code) { | 596 Handle<Code> code) { |
| 590 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); | 597 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); |
| 591 function->shared()->set_code(*code); | 598 function->shared()->set_code(*code); |
| 592 function->set_code(*code); | 599 function->set_code(*code); |
| 593 ASSERT(!function->has_initial_map()); | 600 ASSERT(!function->has_initial_map()); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 // allocate extra space for a literals array prefix containing the | 755 // allocate extra space for a literals array prefix containing the |
| 749 // context. | 756 // context. |
| 750 if (number_of_literals > 0) { | 757 if (number_of_literals > 0) { |
| 751 literals_array_size += JSFunction::kLiteralsPrefixSize; | 758 literals_array_size += JSFunction::kLiteralsPrefixSize; |
| 752 } | 759 } |
| 753 shared->set_num_literals(literals_array_size); | 760 shared->set_num_literals(literals_array_size); |
| 754 return shared; | 761 return shared; |
| 755 } | 762 } |
| 756 | 763 |
| 757 | 764 |
| 765 Handle<JSMessageObject> Factory::NewJSMessageObject( |
| 766 Handle<String> type, |
| 767 Handle<JSArray> arguments, |
| 768 int start_position, |
| 769 int end_position, |
| 770 Handle<Object> script, |
| 771 Handle<Object> stack_trace, |
| 772 Handle<Object> stack_frames) { |
| 773 CALL_HEAP_FUNCTION(Heap::AllocateJSMessageObject(*type, |
| 774 *arguments, |
| 775 start_position, |
| 776 end_position, |
| 777 *script, |
| 778 *stack_trace, |
| 779 *stack_frames), |
| 780 JSMessageObject); |
| 781 } |
| 782 |
| 758 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(Handle<String> name) { | 783 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(Handle<String> name) { |
| 759 CALL_HEAP_FUNCTION(Heap::AllocateSharedFunctionInfo(*name), | 784 CALL_HEAP_FUNCTION(Heap::AllocateSharedFunctionInfo(*name), |
| 760 SharedFunctionInfo); | 785 SharedFunctionInfo); |
| 761 } | 786 } |
| 762 | 787 |
| 763 | 788 |
| 764 Handle<String> Factory::NumberToString(Handle<Object> number) { | 789 Handle<String> Factory::NumberToString(Handle<Object> number) { |
| 765 CALL_HEAP_FUNCTION(Heap::NumberToString(*number), String); | 790 CALL_HEAP_FUNCTION(Heap::NumberToString(*number), String); |
| 766 } | 791 } |
| 767 | 792 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 Execution::ConfigureInstance(instance, | 1078 Execution::ConfigureInstance(instance, |
| 1054 instance_template, | 1079 instance_template, |
| 1055 pending_exception); | 1080 pending_exception); |
| 1056 } else { | 1081 } else { |
| 1057 *pending_exception = false; | 1082 *pending_exception = false; |
| 1058 } | 1083 } |
| 1059 } | 1084 } |
| 1060 | 1085 |
| 1061 | 1086 |
| 1062 } } // namespace v8::internal | 1087 } } // namespace v8::internal |
| OLD | NEW |