OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/log.h" | 5 #include "src/log.h" |
6 | 6 |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) { | 138 if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) { |
139 utf8_pos_ += size; | 139 utf8_pos_ += size; |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 const char* get() { return utf8_buffer_; } | 143 const char* get() { return utf8_buffer_; } |
144 int size() const { return utf8_pos_; } | 144 int size() const { return utf8_pos_; } |
145 | 145 |
146 private: | 146 private: |
147 static const int kUtf8BufferSize = 512; | 147 static const int kUtf8BufferSize = 512; |
148 static const int kUtf16BufferSize = 128; | 148 static const int kUtf16BufferSize = kUtf8BufferSize; |
149 | 149 |
150 int utf8_pos_; | 150 int utf8_pos_; |
151 char utf8_buffer_[kUtf8BufferSize]; | 151 char utf8_buffer_[kUtf8BufferSize]; |
152 uc16 utf16_buffer[kUtf16BufferSize]; | 152 uc16 utf16_buffer[kUtf16BufferSize]; |
153 }; | 153 }; |
154 | 154 |
155 | 155 |
156 CodeEventLogger::CodeEventLogger() : name_buffer_(new NameBuffer) { } | 156 CodeEventLogger::CodeEventLogger() : name_buffer_(new NameBuffer) { } |
157 | 157 |
158 CodeEventLogger::~CodeEventLogger() { delete name_buffer_; } | 158 CodeEventLogger::~CodeEventLogger() { delete name_buffer_; } |
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 removeCodeEventListener(jit_logger_); | 1907 removeCodeEventListener(jit_logger_); |
1908 delete jit_logger_; | 1908 delete jit_logger_; |
1909 jit_logger_ = NULL; | 1909 jit_logger_ = NULL; |
1910 } | 1910 } |
1911 | 1911 |
1912 return log_->Close(); | 1912 return log_->Close(); |
1913 } | 1913 } |
1914 | 1914 |
1915 } // namespace internal | 1915 } // namespace internal |
1916 } // namespace v8 | 1916 } // namespace v8 |
OLD | NEW |