Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: src/code-stubs.cc

Issue 16578008: Improved function entry hook coverage (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@post_fix
Patch Set: Fix Windows X64 compile warnings." Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/frames.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
763 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, 760 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function,
764 intptr_t stack_pointer) { 761 intptr_t stack_pointer) {
765 if (entry_hook_ != NULL) 762 FunctionEntryHook entry_hook = Isolate::Current()->function_entry_hook();
766 entry_hook_(function, stack_pointer); 763 ASSERT(entry_hook != NULL);
764 entry_hook(function, stack_pointer);
767 } 765 }
768 766
769 767
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
781 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { 768 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) {
782 int major_key = stub->MajorKey(); 769 int major_key = stub->MajorKey();
783 CodeStubInterfaceDescriptor* descriptor = 770 CodeStubInterfaceDescriptor* descriptor =
784 isolate->code_stub_interface_descriptor(major_key); 771 isolate->code_stub_interface_descriptor(major_key);
785 if (!descriptor->initialized()) { 772 if (!descriptor->initialized()) {
786 stub->InitializeInterfaceDescriptor(isolate, descriptor); 773 stub->InitializeInterfaceDescriptor(isolate, descriptor);
787 } 774 }
788 } 775 }
789 776
790 777
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 InstallDescriptor(isolate, &stub3); 815 InstallDescriptor(isolate, &stub3);
829 } 816 }
830 817
831 InternalArrayConstructorStub::InternalArrayConstructorStub( 818 InternalArrayConstructorStub::InternalArrayConstructorStub(
832 Isolate* isolate) { 819 Isolate* isolate) {
833 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 820 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
834 } 821 }
835 822
836 823
837 } } // namespace v8::internal 824 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698