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

Side by Side Diff: src/top.h

Issue 3828016: Make state stack thread local. When using Lockers the state stacks of... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 2 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/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 23 matching lines...) Expand all
34 namespace internal { 34 namespace internal {
35 35
36 36
37 #define RETURN_IF_SCHEDULED_EXCEPTION() \ 37 #define RETURN_IF_SCHEDULED_EXCEPTION() \
38 if (Top::has_scheduled_exception()) return Top::PromoteScheduledException() 38 if (Top::has_scheduled_exception()) return Top::PromoteScheduledException()
39 39
40 // Top has static variables used for JavaScript execution. 40 // Top has static variables used for JavaScript execution.
41 41
42 class SaveContext; // Forward declaration. 42 class SaveContext; // Forward declaration.
43 class ThreadVisitor; // Defined in v8threads.h 43 class ThreadVisitor; // Defined in v8threads.h
44 class VMState; // Defined in vm-state.h
44 45
45 class ThreadLocalTop BASE_EMBEDDED { 46 class ThreadLocalTop BASE_EMBEDDED {
46 public: 47 public:
47 // Initialize the thread data. 48 // Initialize the thread data.
48 void Initialize(); 49 void Initialize();
49 50
50 // Get the top C++ try catch handler or NULL if none are registered. 51 // Get the top C++ try catch handler or NULL if none are registered.
51 // 52 //
52 // This method is not guarenteed to return an address that can be 53 // This method is not guarenteed to return an address that can be
53 // used for comparison with addresses into the JS stack. If such an 54 // used for comparison with addresses into the JS stack. If such an
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // invariants that hold about pending_exception. We may want to 95 // invariants that hold about pending_exception. We may want to
95 // unify them later. 96 // unify them later.
96 Object* scheduled_exception_; 97 Object* scheduled_exception_;
97 bool external_caught_exception_; 98 bool external_caught_exception_;
98 SaveContext* save_context_; 99 SaveContext* save_context_;
99 v8::TryCatch* catcher_; 100 v8::TryCatch* catcher_;
100 101
101 // Stack. 102 // Stack.
102 Address c_entry_fp_; // the frame pointer of the top c entry frame 103 Address c_entry_fp_; // the frame pointer of the top c entry frame
103 Address handler_; // try-blocks are chained through the stack 104 Address handler_; // try-blocks are chained through the stack
105
104 #ifdef ENABLE_LOGGING_AND_PROFILING 106 #ifdef ENABLE_LOGGING_AND_PROFILING
105 Address js_entry_sp_; // the stack pointer of the bottom js entry frame 107 Address js_entry_sp_; // the stack pointer of the bottom js entry frame
106 #endif 108 #endif
107 109
110 #ifdef ENABLE_VMSTATE_TRACKING
111 VMState* current_vm_state_;
112 #endif
113
108 // Generated code scratch locations. 114 // Generated code scratch locations.
109 int32_t formal_count_; 115 int32_t formal_count_;
110 116
111 // Call back function to report unsafe JS accesses. 117 // Call back function to report unsafe JS accesses.
112 v8::FailedAccessCheckCallback failed_access_check_callback_; 118 v8::FailedAccessCheckCallback failed_access_check_callback_;
113 119
114 private: 120 private:
115 Address try_catch_handler_address_; 121 Address try_catch_handler_address_;
116 }; 122 };
117 123
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 #ifdef ENABLE_LOGGING_AND_PROFILING 253 #ifdef ENABLE_LOGGING_AND_PROFILING
248 // Bottom JS entry (see StackTracer::Trace in log.cc). 254 // Bottom JS entry (see StackTracer::Trace in log.cc).
249 static Address js_entry_sp(ThreadLocalTop* thread) { 255 static Address js_entry_sp(ThreadLocalTop* thread) {
250 return thread->js_entry_sp_; 256 return thread->js_entry_sp_;
251 } 257 }
252 static inline Address* js_entry_sp_address() { 258 static inline Address* js_entry_sp_address() {
253 return &thread_local_.js_entry_sp_; 259 return &thread_local_.js_entry_sp_;
254 } 260 }
255 #endif 261 #endif
256 262
263 #ifdef ENABLE_VMSTATE_TRACKING
264 static VMState* current_vm_state() {
265 return thread_local_.current_vm_state_;
266 }
267
268 static void set_current_vm_state(VMState* state) {
269 thread_local_.current_vm_state_ = state;
270 }
271 #endif
272
257 // Generated code scratch locations. 273 // Generated code scratch locations.
258 static void* formal_count_address() { return &thread_local_.formal_count_; } 274 static void* formal_count_address() { return &thread_local_.formal_count_; }
259 275
260 static void PrintCurrentStackTrace(FILE* out); 276 static void PrintCurrentStackTrace(FILE* out);
261 static void PrintStackTrace(FILE* out, char* thread_data); 277 static void PrintStackTrace(FILE* out, char* thread_data);
262 static void PrintStack(StringStream* accumulator); 278 static void PrintStack(StringStream* accumulator);
263 static void PrintStack(); 279 static void PrintStack();
264 static Handle<String> StackTraceString(); 280 static Handle<String> StackTraceString();
265 static Handle<JSArray> CaptureCurrentStackTrace( 281 static Handle<JSArray> CaptureCurrentStackTrace(
266 int frame_limit, 282 int frame_limit,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 461
446 class ExecutionAccess BASE_EMBEDDED { 462 class ExecutionAccess BASE_EMBEDDED {
447 public: 463 public:
448 ExecutionAccess(); 464 ExecutionAccess();
449 ~ExecutionAccess(); 465 ~ExecutionAccess();
450 }; 466 };
451 467
452 } } // namespace v8::internal 468 } } // namespace v8::internal
453 469
454 #endif // V8_TOP_H_ 470 #endif // V8_TOP_H_
OLDNEW
« no previous file with comments | « no previous file | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698