OLD | NEW |
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return top_addresses[id]; | 55 return top_addresses[id]; |
56 } | 56 } |
57 | 57 |
58 char* Top::Iterate(ObjectVisitor* v, char* thread_storage) { | 58 char* Top::Iterate(ObjectVisitor* v, char* thread_storage) { |
59 ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(thread_storage); | 59 ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(thread_storage); |
60 Iterate(v, thread); | 60 Iterate(v, thread); |
61 return thread_storage + sizeof(ThreadLocalTop); | 61 return thread_storage + sizeof(ThreadLocalTop); |
62 } | 62 } |
63 | 63 |
64 | 64 |
65 #define VISIT(field) v->VisitPointer(reinterpret_cast<Object**>(&(field))); | |
66 | |
67 void Top::Iterate(ObjectVisitor* v, ThreadLocalTop* thread) { | 65 void Top::Iterate(ObjectVisitor* v, ThreadLocalTop* thread) { |
68 v->VisitPointer(&(thread->pending_exception_)); | 66 v->VisitPointer(&(thread->pending_exception_)); |
69 v->VisitPointer(&(thread->pending_message_obj_)); | 67 v->VisitPointer(&(thread->pending_message_obj_)); |
70 v->VisitPointer( | 68 v->VisitPointer( |
71 bit_cast<Object**, Script**>(&(thread->pending_message_script_))); | 69 bit_cast<Object**, Script**>(&(thread->pending_message_script_))); |
72 v->VisitPointer(bit_cast<Object**, Context**>(&(thread->context_))); | 70 v->VisitPointer(bit_cast<Object**, Context**>(&(thread->context_))); |
73 v->VisitPointer(&(thread->scheduled_exception_)); | 71 v->VisitPointer(&(thread->scheduled_exception_)); |
74 | 72 |
75 for (v8::TryCatch* block = thread->try_catch_handler_; | 73 for (v8::TryCatch* block = thread->try_catch_handler_; |
76 block != NULL; | 74 block != NULL; |
77 block = block->next_) { | 75 block = block->next_) { |
78 v->VisitPointer(bit_cast<Object**, void**>(&(block->exception_))); | 76 v->VisitPointer(bit_cast<Object**, void**>(&(block->exception_))); |
79 v->VisitPointer(bit_cast<Object**, void**>(&(block->message_))); | 77 v->VisitPointer(bit_cast<Object**, void**>(&(block->message_))); |
80 } | 78 } |
81 | 79 |
82 // Iterate over pointers on native execution stack. | 80 // Iterate over pointers on native execution stack. |
83 for (StackFrameIterator it(thread); !it.done(); it.Advance()) { | 81 for (StackFrameIterator it(thread); !it.done(); it.Advance()) { |
84 it.frame()->Iterate(v); | 82 it.frame()->Iterate(v); |
85 } | 83 } |
86 } | 84 } |
87 #undef VISIT | |
88 | 85 |
89 | 86 |
90 void Top::Iterate(ObjectVisitor* v) { | 87 void Top::Iterate(ObjectVisitor* v) { |
91 ThreadLocalTop* current_t = &thread_local_; | 88 ThreadLocalTop* current_t = &thread_local_; |
92 Iterate(v, current_t); | 89 Iterate(v, current_t); |
93 } | 90 } |
94 | 91 |
95 | 92 |
96 void Top::InitializeThreadLocal() { | 93 void Top::InitializeThreadLocal() { |
97 thread_local_.c_entry_fp_ = 0; | 94 thread_local_.c_entry_fp_ = 0; |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 Top::break_access_->Lock(); | 954 Top::break_access_->Lock(); |
958 } | 955 } |
959 | 956 |
960 | 957 |
961 ExecutionAccess::~ExecutionAccess() { | 958 ExecutionAccess::~ExecutionAccess() { |
962 Top::break_access_->Unlock(); | 959 Top::break_access_->Unlock(); |
963 } | 960 } |
964 | 961 |
965 | 962 |
966 } } // namespace v8::internal | 963 } } // namespace v8::internal |
OLD | NEW |