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

Side by Side Diff: include/v8.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: Sketch ARM code stub. 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 | « no previous file | src/api.cc » ('j') | src/arm/assembler-arm.cc » ('J')
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 2907 matching lines...) Expand 10 before | Expand all | Expand 10 after
2918 * When invoked, return_addr_location will point to a location on stack where 2918 * When invoked, return_addr_location will point to a location on stack where
2919 * a machine return address resides, this function should return either the 2919 * a machine return address resides, this function should return either the
2920 * same pointer, or a pointer to the profiler's copy of the original return 2920 * same pointer, or a pointer to the profiler's copy of the original return
2921 * address. 2921 * address.
2922 */ 2922 */
2923 typedef uintptr_t (*ReturnAddressLocationResolver)( 2923 typedef uintptr_t (*ReturnAddressLocationResolver)(
2924 uintptr_t return_addr_location); 2924 uintptr_t return_addr_location);
2925 2925
2926 2926
2927 /** 2927 /**
2928 * FunctionEntryHook is the type of the profile entry hook called at entry to
2929 * any generated function when function-level profiling is enabled.
2930 */
2931 typedef void (*FunctionEntryHook)(intptr_t function,
2932 intptr_t stack_pointer,
2933 uint64_t entry_time);
2934
2935
2936 /**
2928 * Interface for iterating though all external resources in the heap. 2937 * Interface for iterating though all external resources in the heap.
2929 */ 2938 */
2930 class V8EXPORT ExternalResourceVisitor { // NOLINT 2939 class V8EXPORT ExternalResourceVisitor { // NOLINT
2931 public: 2940 public:
2932 virtual ~ExternalResourceVisitor() {} 2941 virtual ~ExternalResourceVisitor() {}
2933 virtual void VisitExternalString(Handle<String> string) {} 2942 virtual void VisitExternalString(Handle<String> string) {}
2934 }; 2943 };
2935 2944
2936 2945
2937 /** 2946 /**
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 static void SetEntropySource(EntropySource source); 3187 static void SetEntropySource(EntropySource source);
3179 3188
3180 /** 3189 /**
3181 * Allows the host application to provide a callback that allows v8 to 3190 * Allows the host application to provide a callback that allows v8 to
3182 * cooperate with a profiler that rewrites return addresses on stack. 3191 * cooperate with a profiler that rewrites return addresses on stack.
3183 */ 3192 */
3184 static void SetReturnAddressLocationResolver( 3193 static void SetReturnAddressLocationResolver(
3185 ReturnAddressLocationResolver return_address_resolver); 3194 ReturnAddressLocationResolver return_address_resolver);
3186 3195
3187 /** 3196 /**
3197 * Allows the host application to provide the address of a function that's
3198 * invoked on entry to every V8-generated function.
3199 * Note that \p entry_hook is invoked at the very start of each
3200 * generated function.
3201 *
3202 * \param entry_hook a function that will be invoked on entry to every
3203 * V8-generated function.
3204 * \returns true on success on supported platforms, false on failure.
3205 * \note Setting a new entry hook function when one is already active will
3206 * fail.
3207 */
3208 static bool SetFunctionEntryHook(FunctionEntryHook entry_hook);
3209
3210 /**
3188 * Adjusts the amount of registered external memory. Used to give 3211 * Adjusts the amount of registered external memory. Used to give
3189 * V8 an indication of the amount of externally allocated memory 3212 * V8 an indication of the amount of externally allocated memory
3190 * that is kept alive by JavaScript objects. V8 uses this to decide 3213 * that is kept alive by JavaScript objects. V8 uses this to decide
3191 * when to perform global garbage collections. Registering 3214 * when to perform global garbage collections. Registering
3192 * externally allocated memory will trigger global garbage 3215 * externally allocated memory will trigger global garbage
3193 * collections more often than otherwise in an attempt to garbage 3216 * collections more often than otherwise in an attempt to garbage
3194 * collect the JavaScript objects keeping the externally allocated 3217 * collect the JavaScript objects keeping the externally allocated
3195 * memory alive. 3218 * memory alive.
3196 * 3219 *
3197 * \param change_in_bytes the change in externally allocated memory 3220 * \param change_in_bytes the change in externally allocated memory
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
4502 4525
4503 4526
4504 } // namespace v8 4527 } // namespace v8
4505 4528
4506 4529
4507 #undef V8EXPORT 4530 #undef V8EXPORT
4508 #undef TYPE_CHECK 4531 #undef TYPE_CHECK
4509 4532
4510 4533
4511 #endif // V8_H_ 4534 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/arm/assembler-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698