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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 JS_CONTEXT_EXTENSION_OBJECT_TYPE, | 813 JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
814 JSObject::kHeaderSize, | 814 JSObject::kHeaderSize, |
815 code, | 815 code, |
816 true); | 816 true); |
817 | 817 |
818 Handle<String> name = Factory::LookupAsciiSymbol("context_extension"); | 818 Handle<String> name = Factory::LookupAsciiSymbol("context_extension"); |
819 context_extension_fun->shared()->set_instance_class_name(*name); | 819 context_extension_fun->shared()->set_instance_class_name(*name); |
820 global_context()->set_context_extension_function(*context_extension_fun); | 820 global_context()->set_context_extension_function(*context_extension_fun); |
821 } | 821 } |
822 | 822 |
823 // Setup the call-as-function delegate. | 823 |
824 Handle<Code> code = | 824 { |
825 Handle<Code>(Builtins::builtin(Builtins::HandleApiCallAsFunction)); | 825 // Setup the call-as-function delegate. |
826 Handle<JSFunction> delegate = | 826 Handle<Code> code = |
827 Factory::NewFunction(Factory::empty_symbol(), JS_OBJECT_TYPE, | 827 Handle<Code>(Builtins::builtin(Builtins::HandleApiCallAsFunction)); |
828 JSObject::kHeaderSize, code, true); | 828 Handle<JSFunction> delegate = |
829 global_context()->set_call_as_function_delegate(*delegate); | 829 Factory::NewFunction(Factory::empty_symbol(), JS_OBJECT_TYPE, |
830 delegate->shared()->DontAdaptArguments(); | 830 JSObject::kHeaderSize, code, true); |
| 831 global_context()->set_call_as_function_delegate(*delegate); |
| 832 delegate->shared()->DontAdaptArguments(); |
| 833 } |
| 834 |
| 835 { |
| 836 // Setup the call-as-constructor delegate. |
| 837 Handle<Code> code = |
| 838 Handle<Code>(Builtins::builtin(Builtins::HandleApiCallAsConstructor)); |
| 839 Handle<JSFunction> delegate = |
| 840 Factory::NewFunction(Factory::empty_symbol(), JS_OBJECT_TYPE, |
| 841 JSObject::kHeaderSize, code, true); |
| 842 global_context()->set_call_as_constructor_delegate(*delegate); |
| 843 delegate->shared()->DontAdaptArguments(); |
| 844 } |
831 | 845 |
832 global_context()->set_special_function_table(Heap::empty_fixed_array()); | 846 global_context()->set_special_function_table(Heap::empty_fixed_array()); |
833 | 847 |
834 // Initialize the out of memory slot. | 848 // Initialize the out of memory slot. |
835 global_context()->set_out_of_memory(Heap::false_value()); | 849 global_context()->set_out_of_memory(Heap::false_value()); |
836 | 850 |
837 // Initialize the data slot. | 851 // Initialize the data slot. |
838 global_context()->set_data(Heap::undefined_value()); | 852 global_context()->set_data(Heap::undefined_value()); |
839 } | 853 } |
840 | 854 |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 } | 1581 } |
1568 | 1582 |
1569 | 1583 |
1570 // Restore statics that are thread local. | 1584 // Restore statics that are thread local. |
1571 char* Genesis::RestoreState(char* from) { | 1585 char* Genesis::RestoreState(char* from) { |
1572 current_ = *reinterpret_cast<Genesis**>(from); | 1586 current_ = *reinterpret_cast<Genesis**>(from); |
1573 return from + sizeof(current_); | 1587 return from + sizeof(current_); |
1574 } | 1588 } |
1575 | 1589 |
1576 } } // namespace v8::internal | 1590 } } // namespace v8::internal |
OLD | NEW |