| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 | 720 |
| 721 | 721 |
| 722 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { | 722 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { |
| 723 StubFailureTrampolineStub stub1(NOT_JS_FUNCTION_STUB_MODE); | 723 StubFailureTrampolineStub stub1(NOT_JS_FUNCTION_STUB_MODE); |
| 724 StubFailureTrampolineStub stub2(JS_FUNCTION_STUB_MODE); | 724 StubFailureTrampolineStub stub2(JS_FUNCTION_STUB_MODE); |
| 725 stub1.GetCode(isolate)->set_is_pregenerated(true); | 725 stub1.GetCode(isolate)->set_is_pregenerated(true); |
| 726 stub2.GetCode(isolate)->set_is_pregenerated(true); | 726 stub2.GetCode(isolate)->set_is_pregenerated(true); |
| 727 } | 727 } |
| 728 | 728 |
| 729 | 729 |
| 730 FunctionEntryHook ProfileEntryHookStub::entry_hook_ = NULL; | |
| 731 | |
| 732 | |
| 733 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, | 730 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, |
| 734 intptr_t stack_pointer) { | 731 intptr_t stack_pointer) { |
| 735 if (entry_hook_ != NULL) | 732 FunctionEntryHook entry_hook = Isolate::Current()->GetFunctionEntryHook(); |
| 736 entry_hook_(function, stack_pointer); | 733 if (entry_hook != NULL) |
| 734 entry_hook(function, stack_pointer); |
| 737 } | 735 } |
| 738 | 736 |
| 739 | 737 |
| 740 bool ProfileEntryHookStub::SetFunctionEntryHook(FunctionEntryHook entry_hook) { | |
| 741 // We don't allow setting a new entry hook over one that's | |
| 742 // already active, as the hooks won't stack. | |
| 743 if (entry_hook != 0 && entry_hook_ != 0) | |
| 744 return false; | |
| 745 | |
| 746 entry_hook_ = entry_hook; | |
| 747 return true; | |
| 748 } | |
| 749 | |
| 750 | |
| 751 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { | 738 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { |
| 752 int major_key = stub->MajorKey(); | 739 int major_key = stub->MajorKey(); |
| 753 CodeStubInterfaceDescriptor* descriptor = | 740 CodeStubInterfaceDescriptor* descriptor = |
| 754 isolate->code_stub_interface_descriptor(major_key); | 741 isolate->code_stub_interface_descriptor(major_key); |
| 755 if (!descriptor->initialized()) { | 742 if (!descriptor->initialized()) { |
| 756 stub->InitializeInterfaceDescriptor(isolate, descriptor); | 743 stub->InitializeInterfaceDescriptor(isolate, descriptor); |
| 757 } | 744 } |
| 758 } | 745 } |
| 759 | 746 |
| 760 | 747 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 InstallDescriptor(isolate, &stub3); | 785 InstallDescriptor(isolate, &stub3); |
| 799 } | 786 } |
| 800 | 787 |
| 801 InternalArrayConstructorStub::InternalArrayConstructorStub( | 788 InternalArrayConstructorStub::InternalArrayConstructorStub( |
| 802 Isolate* isolate) { | 789 Isolate* isolate) { |
| 803 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 790 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 804 } | 791 } |
| 805 | 792 |
| 806 | 793 |
| 807 } } // namespace v8::internal | 794 } } // namespace v8::internal |
| OLD | NEW |