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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 return fun; | 664 return fun; |
665 } | 665 } |
666 | 666 |
667 | 667 |
668 Handle<Object> Factory::ToObject(Handle<Object> object, | 668 Handle<Object> Factory::ToObject(Handle<Object> object, |
669 Handle<Context> global_context) { | 669 Handle<Context> global_context) { |
670 CALL_HEAP_FUNCTION(object->ToObject(*global_context), Object); | 670 CALL_HEAP_FUNCTION(object->ToObject(*global_context), Object); |
671 } | 671 } |
672 | 672 |
673 | 673 |
| 674 #ifdef ENABLE_DEBUGGER_SUPPORT |
674 Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { | 675 Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { |
675 // Get the original code of the function. | 676 // Get the original code of the function. |
676 Handle<Code> code(shared->code()); | 677 Handle<Code> code(shared->code()); |
677 | 678 |
678 // Create a copy of the code before allocating the debug info object to avoid | 679 // Create a copy of the code before allocating the debug info object to avoid |
679 // allocation while setting up the debug info object. | 680 // allocation while setting up the debug info object. |
680 Handle<Code> original_code(*Factory::CopyCode(code)); | 681 Handle<Code> original_code(*Factory::CopyCode(code)); |
681 | 682 |
682 // Allocate initial fixed array for active break points before allocating the | 683 // Allocate initial fixed array for active break points before allocating the |
683 // debug info object to avoid allocation while setting up the debug info | 684 // debug info object to avoid allocation while setting up the debug info |
684 // object. | 685 // object. |
685 Handle<FixedArray> break_points( | 686 Handle<FixedArray> break_points( |
686 Factory::NewFixedArray(Debug::kEstimatedNofBreakPointsInFunction)); | 687 Factory::NewFixedArray(Debug::kEstimatedNofBreakPointsInFunction)); |
687 | 688 |
688 // Create and set up the debug info object. Debug info contains function, a | 689 // Create and set up the debug info object. Debug info contains function, a |
689 // copy of the original code, the executing code and initial fixed array for | 690 // copy of the original code, the executing code and initial fixed array for |
690 // active break points. | 691 // active break points. |
691 Handle<DebugInfo> debug_info = | 692 Handle<DebugInfo> debug_info = |
692 Handle<DebugInfo>::cast(Factory::NewStruct(DEBUG_INFO_TYPE)); | 693 Handle<DebugInfo>::cast(Factory::NewStruct(DEBUG_INFO_TYPE)); |
693 debug_info->set_shared(*shared); | 694 debug_info->set_shared(*shared); |
694 debug_info->set_original_code(*original_code); | 695 debug_info->set_original_code(*original_code); |
695 debug_info->set_code(*code); | 696 debug_info->set_code(*code); |
696 debug_info->set_break_points(*break_points); | 697 debug_info->set_break_points(*break_points); |
697 | 698 |
698 // Link debug info to function. | 699 // Link debug info to function. |
699 shared->set_debug_info(*debug_info); | 700 shared->set_debug_info(*debug_info); |
700 | 701 |
701 return debug_info; | 702 return debug_info; |
702 } | 703 } |
| 704 #endif |
703 | 705 |
704 | 706 |
705 Handle<JSObject> Factory::NewArgumentsObject(Handle<Object> callee, | 707 Handle<JSObject> Factory::NewArgumentsObject(Handle<Object> callee, |
706 int length) { | 708 int length) { |
707 CALL_HEAP_FUNCTION(Heap::AllocateArgumentsObject(*callee, length), JSObject); | 709 CALL_HEAP_FUNCTION(Heap::AllocateArgumentsObject(*callee, length), JSObject); |
708 } | 710 } |
709 | 711 |
710 | 712 |
711 Handle<JSFunction> Factory::CreateApiFunction( | 713 Handle<JSFunction> Factory::CreateApiFunction( |
712 Handle<FunctionTemplateInfo> obj, ApiInstanceType instance_type) { | 714 Handle<FunctionTemplateInfo> obj, ApiInstanceType instance_type) { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 Execution::ConfigureInstance(instance, | 895 Execution::ConfigureInstance(instance, |
894 instance_template, | 896 instance_template, |
895 pending_exception); | 897 pending_exception); |
896 } else { | 898 } else { |
897 *pending_exception = false; | 899 *pending_exception = false; |
898 } | 900 } |
899 } | 901 } |
900 | 902 |
901 | 903 |
902 } } // namespace v8::internal | 904 } } // namespace v8::internal |
OLD | NEW |