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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 class PreallocatedMemoryThread: public Thread { | 109 class PreallocatedMemoryThread: public Thread { |
110 public: | 110 public: |
111 PreallocatedMemoryThread() : keep_running_(true) { | 111 PreallocatedMemoryThread() : keep_running_(true) { |
112 wait_for_ever_semaphore_ = OS::CreateSemaphore(0); | 112 wait_for_ever_semaphore_ = OS::CreateSemaphore(0); |
113 data_ready_semaphore_ = OS::CreateSemaphore(0); | 113 data_ready_semaphore_ = OS::CreateSemaphore(0); |
114 } | 114 } |
115 | 115 |
116 // When the thread starts running it will allocate a fixed number of bytes | 116 // When the thread starts running it will allocate a fixed number of bytes |
117 // on the stack and publish the location of this memory for others to use. | 117 // on the stack and publish the location of this memory for others to use. |
118 void Run() { | 118 void Run() { |
119 EmbeddedVector<char, 32 * 1024> local_buffer; | 119 EmbeddedVector<char, 15 * 1024> local_buffer; |
120 | 120 |
121 // Initialize the buffer with a known good value. | 121 // Initialize the buffer with a known good value. |
122 OS::StrNCpy(local_buffer, "Trace data was not generated.\n", | 122 OS::StrNCpy(local_buffer, "Trace data was not generated.\n", |
123 local_buffer.length()); | 123 local_buffer.length()); |
124 | 124 |
125 // Publish the local buffer and signal its availability. | 125 // Publish the local buffer and signal its availability. |
126 data_ = &local_buffer[0]; | 126 data_ = &local_buffer[0]; |
127 length_ = sizeof(local_buffer); | 127 length_ = sizeof(local_buffer); |
128 data_ready_semaphore_->Signal(); | 128 data_ready_semaphore_->Signal(); |
129 | 129 |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 Top::break_access_->Lock(); | 912 Top::break_access_->Lock(); |
913 } | 913 } |
914 | 914 |
915 | 915 |
916 ExecutionAccess::~ExecutionAccess() { | 916 ExecutionAccess::~ExecutionAccess() { |
917 Top::break_access_->Unlock(); | 917 Top::break_access_->Unlock(); |
918 } | 918 } |
919 | 919 |
920 | 920 |
921 } } // namespace v8::internal | 921 } } // namespace v8::internal |
OLD | NEW |