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

Side by Side Diff: src/top.h

Issue 251014: * Fix memory leaks caused by thread local data being lost.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | « src/serialize.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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #endif 71 #endif
72 bool stack_is_cooked_; 72 bool stack_is_cooked_;
73 inline bool stack_is_cooked() { return stack_is_cooked_; } 73 inline bool stack_is_cooked() { return stack_is_cooked_; }
74 inline void set_stack_is_cooked(bool value) { stack_is_cooked_ = value; } 74 inline void set_stack_is_cooked(bool value) { stack_is_cooked_ = value; }
75 75
76 // Generated code scratch locations. 76 // Generated code scratch locations.
77 int32_t formal_count_; 77 int32_t formal_count_;
78 78
79 // Call back function to report unsafe JS accesses. 79 // Call back function to report unsafe JS accesses.
80 v8::FailedAccessCheckCallback failed_access_check_callback_; 80 v8::FailedAccessCheckCallback failed_access_check_callback_;
81
82 void Free() {
83 ASSERT(!has_pending_message_);
84 ASSERT(!external_caught_exception_);
85 ASSERT(try_catch_handler_ == NULL);
86 }
81 }; 87 };
82 88
83 #define TOP_ADDRESS_LIST(C) \ 89 #define TOP_ADDRESS_LIST(C) \
84 C(handler_address) \ 90 C(handler_address) \
85 C(c_entry_fp_address) \ 91 C(c_entry_fp_address) \
86 C(context_address) \ 92 C(context_address) \
87 C(pending_exception_address) \ 93 C(pending_exception_address) \
88 C(external_caught_exception_address) 94 C(external_caught_exception_address)
89 95
90 #ifdef ENABLE_LOGGING_AND_PROFILING 96 #ifdef ENABLE_LOGGING_AND_PROFILING
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 static Handle<type> name() { \ 315 static Handle<type> name() { \
310 return Handle<type>(context()->global_context()->name()); \ 316 return Handle<type>(context()->global_context()->name()); \
311 } 317 }
312 GLOBAL_CONTEXT_FIELDS(TOP_GLOBAL_CONTEXT_FIELD_ACCESSOR) 318 GLOBAL_CONTEXT_FIELDS(TOP_GLOBAL_CONTEXT_FIELD_ACCESSOR)
313 #undef TOP_GLOBAL_CONTEXT_FIELD_ACCESSOR 319 #undef TOP_GLOBAL_CONTEXT_FIELD_ACCESSOR
314 320
315 static inline ThreadLocalTop* GetCurrentThread() { return &thread_local_; } 321 static inline ThreadLocalTop* GetCurrentThread() { return &thread_local_; }
316 static int ArchiveSpacePerThread() { return sizeof(ThreadLocalTop); } 322 static int ArchiveSpacePerThread() { return sizeof(ThreadLocalTop); }
317 static char* ArchiveThread(char* to); 323 static char* ArchiveThread(char* to);
318 static char* RestoreThread(char* from); 324 static char* RestoreThread(char* from);
325 static void FreeThreadResources() { thread_local_.Free(); }
319 326
320 static const char* kStackOverflowMessage; 327 static const char* kStackOverflowMessage;
321 328
322 private: 329 private:
323 // The context that initiated this JS execution. 330 // The context that initiated this JS execution.
324 static ThreadLocalTop thread_local_; 331 static ThreadLocalTop thread_local_;
325 static void InitializeThreadLocal(); 332 static void InitializeThreadLocal();
326 static void PrintStackTrace(FILE* out, ThreadLocalTop* thread); 333 static void PrintStackTrace(FILE* out, ThreadLocalTop* thread);
327 static void MarkCompactPrologue(bool is_compacting, 334 static void MarkCompactPrologue(bool is_compacting,
328 ThreadLocalTop* archived_thread_data); 335 ThreadLocalTop* archived_thread_data);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 412
406 class ExecutionAccess BASE_EMBEDDED { 413 class ExecutionAccess BASE_EMBEDDED {
407 public: 414 public:
408 ExecutionAccess(); 415 ExecutionAccess();
409 ~ExecutionAccess(); 416 ~ExecutionAccess();
410 }; 417 };
411 418
412 } } // namespace v8::internal 419 } } // namespace v8::internal
413 420
414 #endif // V8_TOP_H_ 421 #endif // V8_TOP_H_
OLDNEW
« no previous file with comments | « src/serialize.cc ('k') | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698