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 3024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3035 | 3035 |
3036 /** | 3036 /** |
3037 * A JIT code event is issued each time code is added, moved or removed. | 3037 * A JIT code event is issued each time code is added, moved or removed. |
3038 * | 3038 * |
3039 * \note removal events are not currently issued. | 3039 * \note removal events are not currently issued. |
3040 */ | 3040 */ |
3041 struct JitCodeEvent { | 3041 struct JitCodeEvent { |
3042 enum EventType { | 3042 enum EventType { |
3043 CODE_ADDED, | 3043 CODE_ADDED, |
3044 CODE_MOVED, | 3044 CODE_MOVED, |
3045 CODE_REMOVED | 3045 CODE_REMOVED, |
| 3046 CODE_ADD_LINE_POS_INFO, |
| 3047 CODE_START_LINE_INFO_RECORDING, |
| 3048 CODE_END_LINE_INFO_RECORDING |
| 3049 }; |
| 3050 // Definition of the code position type. The "POSITION" type means the place |
| 3051 // in the source code which are of interest when making stack traces to |
| 3052 // pin-point the source location of a stack frame as close as possible. |
| 3053 // The "STATEMENT_POSITION" means the place at the beginning of each |
| 3054 // statement, and is used to indicate possible break locations. |
| 3055 enum PositionType { |
| 3056 POSITION, |
| 3057 STATEMENT_POSITION |
3046 }; | 3058 }; |
3047 | 3059 |
3048 // Type of event. | 3060 // Type of event. |
3049 EventType type; | 3061 EventType type; |
3050 // Start of the instructions. | 3062 // Start of the instructions. |
3051 void* code_start; | 3063 void* code_start; |
3052 // Size of the instructions. | 3064 // Size of the instructions. |
3053 size_t code_len; | 3065 size_t code_len; |
| 3066 // Script info for CODE_ADDED event. |
| 3067 Handle<Script> script; |
| 3068 // User-defined data for *_LINE_INFO_* event. It's used to hold the source |
| 3069 // code line information which is returned from the |
| 3070 // CODE_START_LINE_INFO_RECORDING event. And it's passed to subsequent |
| 3071 // CODE_ADD_LINE_POS_INFO and CODE_END_LINE_INFO_RECORDING events. |
| 3072 void* user_data; |
3054 | 3073 |
3055 union { | 3074 union { |
3056 // Only valid for CODE_ADDED. | 3075 // Only valid for CODE_ADDED. |
3057 struct { | 3076 struct { |
3058 // Name of the object associated with the code, note that the string is | 3077 // Name of the object associated with the code, note that the string is |
3059 // not zero-terminated. | 3078 // not zero-terminated. |
3060 const char* str; | 3079 const char* str; |
3061 // Number of chars in str. | 3080 // Number of chars in str. |
3062 size_t len; | 3081 size_t len; |
3063 } name; | 3082 } name; |
| 3083 |
| 3084 // Only valid for CODE_ADD_LINE_POS_INFO |
| 3085 struct { |
| 3086 // PC offset |
| 3087 size_t offset; |
| 3088 // Code postion |
| 3089 size_t pos; |
| 3090 // The position type. |
| 3091 PositionType position_type; |
| 3092 } line_info; |
| 3093 |
3064 // New location of instructions. Only valid for CODE_MOVED. | 3094 // New location of instructions. Only valid for CODE_MOVED. |
3065 void* new_code_start; | 3095 void* new_code_start; |
3066 }; | 3096 }; |
3067 }; | 3097 }; |
3068 | 3098 |
3069 /** | 3099 /** |
3070 * Option flags passed to the SetJitCodeEventHandler function. | 3100 * Option flags passed to the SetJitCodeEventHandler function. |
3071 */ | 3101 */ |
3072 enum JitCodeEventOptions { | 3102 enum JitCodeEventOptions { |
3073 kJitCodeEventDefault = 0, | 3103 kJitCodeEventDefault = 0, |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4928 | 4958 |
4929 | 4959 |
4930 } // namespace v8 | 4960 } // namespace v8 |
4931 | 4961 |
4932 | 4962 |
4933 #undef V8EXPORT | 4963 #undef V8EXPORT |
4934 #undef TYPE_CHECK | 4964 #undef TYPE_CHECK |
4935 | 4965 |
4936 | 4966 |
4937 #endif // V8_H_ | 4967 #endif // V8_H_ |
OLD | NEW |