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

Side by Side Diff: src/top.h

Issue 39124: Handle thread preemption in debugger (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 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/runtime.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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } 175 static Address handler(ThreadLocalTop* thread) { return thread->handler_; }
176 176
177 static inline Address* c_entry_fp_address() { 177 static inline Address* c_entry_fp_address() {
178 return &thread_local_.c_entry_fp_; 178 return &thread_local_.c_entry_fp_;
179 } 179 }
180 static inline Address* handler_address() { return &thread_local_.handler_; } 180 static inline Address* handler_address() { return &thread_local_.handler_; }
181 181
182 // Generated code scratch locations. 182 // Generated code scratch locations.
183 static void* formal_count_address() { return &thread_local_.formal_count_; } 183 static void* formal_count_address() { return &thread_local_.formal_count_; }
184 184
185 static void new_break(StackFrame::Id break_frame_id);
186 static void set_break(StackFrame::Id break_frame_id, int break_id);
187 static bool check_break(int break_id);
188 static bool is_break();
189 static StackFrame::Id break_frame_id();
190 static int break_id();
191
192 static void MarkCompactPrologue(bool is_compacting); 185 static void MarkCompactPrologue(bool is_compacting);
193 static void MarkCompactEpilogue(bool is_compacting); 186 static void MarkCompactEpilogue(bool is_compacting);
194 static void MarkCompactPrologue(bool is_compacting, 187 static void MarkCompactPrologue(bool is_compacting,
195 char* archived_thread_data); 188 char* archived_thread_data);
196 static void MarkCompactEpilogue(bool is_compacting, 189 static void MarkCompactEpilogue(bool is_compacting,
197 char* archived_thread_data); 190 char* archived_thread_data);
198 static void PrintCurrentStackTrace(FILE* out); 191 static void PrintCurrentStackTrace(FILE* out);
199 static void PrintStackTrace(FILE* out, char* thread_data); 192 static void PrintStackTrace(FILE* out, char* thread_data);
200 static void PrintStack(StringStream* accumulator); 193 static void PrintStack(StringStream* accumulator);
201 static void PrintStack(); 194 static void PrintStack();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 static void PrintStackTrace(FILE* out, ThreadLocalTop* thread); 290 static void PrintStackTrace(FILE* out, ThreadLocalTop* thread);
298 static void MarkCompactPrologue(bool is_compacting, 291 static void MarkCompactPrologue(bool is_compacting,
299 ThreadLocalTop* archived_thread_data); 292 ThreadLocalTop* archived_thread_data);
300 static void MarkCompactEpilogue(bool is_compacting, 293 static void MarkCompactEpilogue(bool is_compacting,
301 ThreadLocalTop* archived_thread_data); 294 ThreadLocalTop* archived_thread_data);
302 295
303 // Debug. 296 // Debug.
304 // Mutex for serializing access to break control structures. 297 // Mutex for serializing access to break control structures.
305 static Mutex* break_access_; 298 static Mutex* break_access_;
306 299
307 // ID of the frame where execution is stopped by debugger.
308 static StackFrame::Id break_frame_id_;
309
310 // Counter to create unique id for each debug break.
311 static int break_count_;
312
313 // Current debug break, 0 if running.
314 static int break_id_;
315
316 friend class SaveContext; 300 friend class SaveContext;
317 friend class AssertNoContextChange; 301 friend class AssertNoContextChange;
318 friend class ExecutionAccess; 302 friend class ExecutionAccess;
319 303
320 static void FillCache(); 304 static void FillCache();
321 }; 305 };
322 306
323 307
324 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the 308 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the
325 // class as a work around for a bug in the generated code found with these 309 // class as a work around for a bug in the generated code found with these
326 // versions of GCC. See V8 issue 122 for details. 310 // versions of GCC. See V8 issue 122 for details.
327 class SaveContext BASE_EMBEDDED { 311 class SaveContext BASE_EMBEDDED {
328 public: 312 public:
329 SaveContext() : 313 SaveContext()
330 context_(Top::context()), 314 : context_(Top::context()),
331 #if __GNUC_VERSION__ >= 40100 && __GNUC_VERSION__ < 40300 315 #if __GNUC_VERSION__ >= 40100 && __GNUC_VERSION__ < 40300
332 dummy_(Top::context()), 316 dummy_(Top::context()),
333 #endif 317 #endif
334 prev_(Top::save_context()) { 318 prev_(Top::save_context()) {
335 Top::set_save_context(this); 319 Top::set_save_context(this);
336 320
337 // If there is no JS frame under the current C frame, use the value 0. 321 // If there is no JS frame under the current C frame, use the value 0.
338 JavaScriptFrameIterator it; 322 JavaScriptFrameIterator it;
339 js_sp_ = it.done() ? 0 : it.frame()->sp(); 323 js_sp_ = it.done() ? 0 : it.frame()->sp();
340 } 324 }
341 325
342 ~SaveContext() { 326 ~SaveContext() {
343 Top::set_context(*context_); 327 Top::set_context(*context_);
344 Top::set_save_context(prev_); 328 Top::set_save_context(prev_);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 369
386 class ExecutionAccess BASE_EMBEDDED { 370 class ExecutionAccess BASE_EMBEDDED {
387 public: 371 public:
388 ExecutionAccess(); 372 ExecutionAccess();
389 ~ExecutionAccess(); 373 ~ExecutionAccess();
390 }; 374 };
391 375
392 } } // namespace v8::internal 376 } } // namespace v8::internal
393 377
394 #endif // V8_TOP_H_ 378 #endif // V8_TOP_H_
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698