OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 Handle<Code> code) { | 534 Handle<Code> code) { |
535 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); | 535 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); |
536 function->set_code(*code); | 536 function->set_code(*code); |
537 ASSERT(!function->has_initial_map()); | 537 ASSERT(!function->has_initial_map()); |
538 ASSERT(!function->has_prototype()); | 538 ASSERT(!function->has_prototype()); |
539 return function; | 539 return function; |
540 } | 540 } |
541 | 541 |
542 | 542 |
543 Handle<Code> Factory::NewCode(const CodeDesc& desc, | 543 Handle<Code> Factory::NewCode(const CodeDesc& desc, |
544 ZoneScopeInfo* sinfo, | |
545 Code::Flags flags, | 544 Code::Flags flags, |
546 Handle<Object> self_ref) { | 545 Handle<Object> self_ref) { |
547 CALL_HEAP_FUNCTION(Heap::CreateCode(desc, sinfo, flags, self_ref), Code); | 546 CALL_HEAP_FUNCTION(Heap::CreateCode(desc, flags, self_ref), Code); |
548 } | 547 } |
549 | 548 |
550 | 549 |
551 Handle<Code> Factory::CopyCode(Handle<Code> code) { | 550 Handle<Code> Factory::CopyCode(Handle<Code> code) { |
552 CALL_HEAP_FUNCTION(Heap::CopyCode(*code), Code); | 551 CALL_HEAP_FUNCTION(Heap::CopyCode(*code), Code); |
553 } | 552 } |
554 | 553 |
555 | 554 |
556 Handle<Code> Factory::CopyCode(Handle<Code> code, Vector<byte> reloc_info) { | 555 Handle<Code> Factory::CopyCode(Handle<Code> code, Vector<byte> reloc_info) { |
557 CALL_HEAP_FUNCTION(Heap::CopyCode(*code, reloc_info), Code); | 556 CALL_HEAP_FUNCTION(Heap::CopyCode(*code, reloc_info), Code); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArray> elements, | 672 Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArray> elements, |
674 PretenureFlag pretenure) { | 673 PretenureFlag pretenure) { |
675 Handle<JSArray> result = | 674 Handle<JSArray> result = |
676 Handle<JSArray>::cast(NewJSObject(Top::array_function(), pretenure)); | 675 Handle<JSArray>::cast(NewJSObject(Top::array_function(), pretenure)); |
677 result->SetContent(*elements); | 676 result->SetContent(*elements); |
678 return result; | 677 return result; |
679 } | 678 } |
680 | 679 |
681 | 680 |
682 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 681 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
683 Handle<String> name, int number_of_literals, Handle<Code> code) { | 682 Handle<String> name, |
| 683 int number_of_literals, |
| 684 Handle<Code> code, |
| 685 Handle<Object> scope_info) { |
684 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); | 686 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); |
685 shared->set_code(*code); | 687 shared->set_code(*code); |
| 688 shared->set_scope_info(*scope_info); |
686 int literals_array_size = number_of_literals; | 689 int literals_array_size = number_of_literals; |
687 // If the function contains object, regexp or array literals, | 690 // If the function contains object, regexp or array literals, |
688 // allocate extra space for a literals array prefix containing the | 691 // allocate extra space for a literals array prefix containing the |
689 // context. | 692 // context. |
690 if (number_of_literals > 0) { | 693 if (number_of_literals > 0) { |
691 literals_array_size += JSFunction::kLiteralsPrefixSize; | 694 literals_array_size += JSFunction::kLiteralsPrefixSize; |
692 } | 695 } |
693 shared->set_num_literals(literals_array_size); | 696 shared->set_num_literals(literals_array_size); |
694 return shared; | 697 return shared; |
695 } | 698 } |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 Execution::ConfigureInstance(instance, | 992 Execution::ConfigureInstance(instance, |
990 instance_template, | 993 instance_template, |
991 pending_exception); | 994 pending_exception); |
992 } else { | 995 } else { |
993 *pending_exception = false; | 996 *pending_exception = false; |
994 } | 997 } |
995 } | 998 } |
996 | 999 |
997 | 1000 |
998 } } // namespace v8::internal | 1001 } } // namespace v8::internal |
OLD | NEW |