OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 | 750 |
751 | 751 |
752 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { | 752 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { |
753 StubFailureTrampolineStub stub1(NOT_JS_FUNCTION_STUB_MODE); | 753 StubFailureTrampolineStub stub1(NOT_JS_FUNCTION_STUB_MODE); |
754 StubFailureTrampolineStub stub2(JS_FUNCTION_STUB_MODE); | 754 StubFailureTrampolineStub stub2(JS_FUNCTION_STUB_MODE); |
755 stub1.GetCode(isolate)->set_is_pregenerated(true); | 755 stub1.GetCode(isolate)->set_is_pregenerated(true); |
756 stub2.GetCode(isolate)->set_is_pregenerated(true); | 756 stub2.GetCode(isolate)->set_is_pregenerated(true); |
757 } | 757 } |
758 | 758 |
759 | 759 |
| 760 FunctionEntryHook ProfileEntryHookStub::entry_hook_ = NULL; |
| 761 |
| 762 |
760 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, | 763 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, |
761 intptr_t stack_pointer) { | 764 intptr_t stack_pointer) { |
762 FunctionEntryHook entry_hook = Isolate::Current()->function_entry_hook(); | 765 if (entry_hook_ != NULL) |
763 ASSERT(entry_hook != NULL); | 766 entry_hook_(function, stack_pointer); |
764 entry_hook(function, stack_pointer); | |
765 } | 767 } |
766 | 768 |
767 | 769 |
| 770 bool ProfileEntryHookStub::SetFunctionEntryHook(FunctionEntryHook entry_hook) { |
| 771 // We don't allow setting a new entry hook over one that's |
| 772 // already active, as the hooks won't stack. |
| 773 if (entry_hook != 0 && entry_hook_ != 0) |
| 774 return false; |
| 775 |
| 776 entry_hook_ = entry_hook; |
| 777 return true; |
| 778 } |
| 779 |
| 780 |
768 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { | 781 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { |
769 int major_key = stub->MajorKey(); | 782 int major_key = stub->MajorKey(); |
770 CodeStubInterfaceDescriptor* descriptor = | 783 CodeStubInterfaceDescriptor* descriptor = |
771 isolate->code_stub_interface_descriptor(major_key); | 784 isolate->code_stub_interface_descriptor(major_key); |
772 if (!descriptor->initialized()) { | 785 if (!descriptor->initialized()) { |
773 stub->InitializeInterfaceDescriptor(isolate, descriptor); | 786 stub->InitializeInterfaceDescriptor(isolate, descriptor); |
774 } | 787 } |
775 } | 788 } |
776 | 789 |
777 | 790 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 InstallDescriptor(isolate, &stub3); | 828 InstallDescriptor(isolate, &stub3); |
816 } | 829 } |
817 | 830 |
818 InternalArrayConstructorStub::InternalArrayConstructorStub( | 831 InternalArrayConstructorStub::InternalArrayConstructorStub( |
819 Isolate* isolate) { | 832 Isolate* isolate) { |
820 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 833 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
821 } | 834 } |
822 | 835 |
823 | 836 |
824 } } // namespace v8::internal | 837 } } // namespace v8::internal |
OLD | NEW |