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

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

Issue 10706002: Implements a new API to set a function entry hook for profiling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make test non-threaded as it manipulates process-global state, and thus can't deterministically run… Created 8 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs.cc » ('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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 V(ArgumentsAccess) \ 66 V(ArgumentsAccess) \
67 V(RegExpConstructResult) \ 67 V(RegExpConstructResult) \
68 V(NumberToString) \ 68 V(NumberToString) \
69 V(CEntry) \ 69 V(CEntry) \
70 V(JSEntry) \ 70 V(JSEntry) \
71 V(KeyedLoadElement) \ 71 V(KeyedLoadElement) \
72 V(KeyedStoreElement) \ 72 V(KeyedStoreElement) \
73 V(DebuggerStatement) \ 73 V(DebuggerStatement) \
74 V(StringDictionaryLookup) \ 74 V(StringDictionaryLookup) \
75 V(ElementsTransitionAndStore) \ 75 V(ElementsTransitionAndStore) \
76 V(StoreArrayLiteralElement) 76 V(StoreArrayLiteralElement) \
77 V(ProfileEntryHook)
77 78
78 // List of code stubs only used on ARM platforms. 79 // List of code stubs only used on ARM platforms.
79 #ifdef V8_TARGET_ARCH_ARM 80 #ifdef V8_TARGET_ARCH_ARM
80 #define CODE_STUB_LIST_ARM(V) \ 81 #define CODE_STUB_LIST_ARM(V) \
81 V(GetProperty) \ 82 V(GetProperty) \
82 V(SetProperty) \ 83 V(SetProperty) \
83 V(InvokeBuiltin) \ 84 V(InvokeBuiltin) \
84 V(RegExpCEntry) \ 85 V(RegExpCEntry) \
85 V(DirectCEntry) 86 V(DirectCEntry)
86 #else 87 #else
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 1136
1136 private: 1137 private:
1137 Major MajorKey() { return StoreArrayLiteralElement; } 1138 Major MajorKey() { return StoreArrayLiteralElement; }
1138 int MinorKey() { return 0; } 1139 int MinorKey() { return 0; }
1139 1140
1140 void Generate(MacroAssembler* masm); 1141 void Generate(MacroAssembler* masm);
1141 1142
1142 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); 1143 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub);
1143 }; 1144 };
1144 1145
1146
1147 class ProfileEntryHookStub : public CodeStub {
1148 public:
1149 explicit ProfileEntryHookStub() {}
1150
1151 // The profile entry hook function is not allowed to cause a GC.
1152 virtual bool SometimesSetsUpAFrame() { return false; }
1153
1154 // Generates a call to the entry hook if it's enabled.
1155 static void MaybeCallEntryHook(MacroAssembler* masm);
1156
1157 // Sets or unsets the entry hook function. Returns true on success,
1158 // false on an attempt to replace a non-NULL entry hook with another
1159 // non-NULL hook.
1160 static bool SetFunctionEntryHook(FunctionEntryHook entry_hook);
1161
1162 private:
1163 static void EntryHookTrampoline(intptr_t function,
1164 intptr_t stack_pointer);
1165
1166 Major MajorKey() { return ProfileEntryHook; }
1167 int MinorKey() { return 0; }
1168
1169 void Generate(MacroAssembler* masm);
1170
1171 // The current function entry hook.
1172 static FunctionEntryHook entry_hook_;
1173
1174 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
1175 };
1176
1145 } } // namespace v8::internal 1177 } } // namespace v8::internal
1146 1178
1147 #endif // V8_CODE_STUBS_H_ 1179 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698