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

Side by Side Diff: src/top.h

Issue 112082: Fix determining of JS lower stack bottom used in profiler's JS stack tracer to work with Chromium. (Closed)
Patch Set: Created 11 years, 6 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/log.cc ('k') | src/top.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // unify them later. 58 // unify them later.
59 Object* scheduled_exception_; 59 Object* scheduled_exception_;
60 bool external_caught_exception_; 60 bool external_caught_exception_;
61 v8::TryCatch* try_catch_handler_; 61 v8::TryCatch* try_catch_handler_;
62 SaveContext* save_context_; 62 SaveContext* save_context_;
63 v8::TryCatch* catcher_; 63 v8::TryCatch* catcher_;
64 64
65 // Stack. 65 // Stack.
66 Address c_entry_fp_; // the frame pointer of the top c entry frame 66 Address c_entry_fp_; // the frame pointer of the top c entry frame
67 Address handler_; // try-blocks are chained through the stack 67 Address handler_; // try-blocks are chained through the stack
68 #ifdef ENABLE_LOGGING_AND_PROFILING
69 Address js_entry_sp_; // the stack pointer of the bottom js entry frame
70 #endif
68 bool stack_is_cooked_; 71 bool stack_is_cooked_;
69 inline bool stack_is_cooked() { return stack_is_cooked_; } 72 inline bool stack_is_cooked() { return stack_is_cooked_; }
70 inline void set_stack_is_cooked(bool value) { stack_is_cooked_ = value; } 73 inline void set_stack_is_cooked(bool value) { stack_is_cooked_ = value; }
71 74
72 // Generated code scratch locations. 75 // Generated code scratch locations.
73 int32_t formal_count_; 76 int32_t formal_count_;
74 77
75 // Call back function to report unsafe JS accesses. 78 // Call back function to report unsafe JS accesses.
76 v8::FailedAccessCheckCallback failed_access_check_callback_; 79 v8::FailedAccessCheckCallback failed_access_check_callback_;
77 }; 80 };
78 81
82 #ifdef ENABLE_LOGGING_AND_PROFILING
83 #define JS_ENTRY_SP_ADDRESS(C) C(js_entry_sp_address)
84 #else
85 #define JS_ENTRY_SP_ADDRESS(C)
86 #endif
87
79 #define TOP_ADDRESS_LIST(C) \ 88 #define TOP_ADDRESS_LIST(C) \
Søren Thygesen Gjesse 2009/06/02 09:00:25 How about making two lists TOP_ADDRESS_LIST_ALWAYS
Mikhail Naganov 2009/06/02 09:32:32 Good idea. Done.
80 C(handler_address) \ 89 C(handler_address) \
81 C(c_entry_fp_address) \ 90 C(c_entry_fp_address) \
91 JS_ENTRY_SP_ADDRESS(C) \
82 C(context_address) \ 92 C(context_address) \
83 C(pending_exception_address) \ 93 C(pending_exception_address) \
84 C(external_caught_exception_address) 94 C(external_caught_exception_address)
85 95
86 class Top { 96 class Top {
87 public: 97 public:
88 enum AddressId { 98 enum AddressId {
89 #define C(name) k_##name, 99 #define C(name) k_##name,
90 TOP_ADDRESS_LIST(C) 100 TOP_ADDRESS_LIST(C)
91 #undef C 101 #undef C
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 static Address c_entry_fp(ThreadLocalTop* thread) { 182 static Address c_entry_fp(ThreadLocalTop* thread) {
173 return thread->c_entry_fp_; 183 return thread->c_entry_fp_;
174 } 184 }
175 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } 185 static Address handler(ThreadLocalTop* thread) { return thread->handler_; }
176 186
177 static inline Address* c_entry_fp_address() { 187 static inline Address* c_entry_fp_address() {
178 return &thread_local_.c_entry_fp_; 188 return &thread_local_.c_entry_fp_;
179 } 189 }
180 static inline Address* handler_address() { return &thread_local_.handler_; } 190 static inline Address* handler_address() { return &thread_local_.handler_; }
181 191
192 #ifdef ENABLE_LOGGING_AND_PROFILING
193 // Bottom JS entry (see StackTracer::Trace in log.cc).
194 static Address js_entry_sp(ThreadLocalTop* thread) {
195 return thread->js_entry_sp_;
196 }
197 static inline Address* js_entry_sp_address() {
198 return &thread_local_.js_entry_sp_;
199 }
200 #endif
201
182 // Generated code scratch locations. 202 // Generated code scratch locations.
183 static void* formal_count_address() { return &thread_local_.formal_count_; } 203 static void* formal_count_address() { return &thread_local_.formal_count_; }
184 204
185 static void MarkCompactPrologue(bool is_compacting); 205 static void MarkCompactPrologue(bool is_compacting);
186 static void MarkCompactEpilogue(bool is_compacting); 206 static void MarkCompactEpilogue(bool is_compacting);
187 static void MarkCompactPrologue(bool is_compacting, 207 static void MarkCompactPrologue(bool is_compacting,
188 char* archived_thread_data); 208 char* archived_thread_data);
189 static void MarkCompactEpilogue(bool is_compacting, 209 static void MarkCompactEpilogue(bool is_compacting,
190 char* archived_thread_data); 210 char* archived_thread_data);
191 static void PrintCurrentStackTrace(FILE* out); 211 static void PrintCurrentStackTrace(FILE* out);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 394
375 class ExecutionAccess BASE_EMBEDDED { 395 class ExecutionAccess BASE_EMBEDDED {
376 public: 396 public:
377 ExecutionAccess(); 397 ExecutionAccess();
378 ~ExecutionAccess(); 398 ~ExecutionAccess();
379 }; 399 };
380 400
381 } } // namespace v8::internal 401 } } // namespace v8::internal
382 402
383 #endif // V8_TOP_H_ 403 #endif // V8_TOP_H_
OLDNEW
« no previous file with comments | « src/log.cc ('k') | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698