| 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 <stdarg.h> | 5 #include <stdarg.h> |
| 6 #include <sys/stat.h> | 6 #include <sys/stat.h> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/base/functional.h" |
| 10 #include "src/base/logging.h" | 11 #include "src/base/logging.h" |
| 11 #include "src/base/platform/platform.h" | 12 #include "src/base/platform/platform.h" |
| 12 #include "src/utils.h" | 13 #include "src/utils.h" |
| 13 | 14 |
| 14 namespace v8 { | 15 namespace v8 { |
| 15 namespace internal { | 16 namespace internal { |
| 16 | 17 |
| 17 | 18 |
| 18 SimpleStringBuilder::SimpleStringBuilder(int size) { | 19 SimpleStringBuilder::SimpleStringBuilder(int size) { |
| 19 buffer_ = Vector<char>::New(size); | 20 buffer_ = Vector<char>::New(size); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 buffer_[position_] = '\0'; | 71 buffer_[position_] = '\0'; |
| 71 // Make sure nobody managed to add a 0-character to the | 72 // Make sure nobody managed to add a 0-character to the |
| 72 // buffer while building the string. | 73 // buffer while building the string. |
| 73 DCHECK(strlen(buffer_.start()) == static_cast<size_t>(position_)); | 74 DCHECK(strlen(buffer_.start()) == static_cast<size_t>(position_)); |
| 74 position_ = -1; | 75 position_ = -1; |
| 75 DCHECK(is_finalized()); | 76 DCHECK(is_finalized()); |
| 76 return buffer_.start(); | 77 return buffer_.start(); |
| 77 } | 78 } |
| 78 | 79 |
| 79 | 80 |
| 81 size_t hash_value(BailoutId id) { |
| 82 base::hash<int> h; |
| 83 return h(id.id_); |
| 84 } |
| 85 |
| 86 |
| 87 std::ostream& operator<<(std::ostream& os, BailoutId id) { |
| 88 return os << id.id_; |
| 89 } |
| 90 |
| 91 |
| 80 void PrintF(const char* format, ...) { | 92 void PrintF(const char* format, ...) { |
| 81 va_list arguments; | 93 va_list arguments; |
| 82 va_start(arguments, format); | 94 va_start(arguments, format); |
| 83 base::OS::VPrint(format, arguments); | 95 base::OS::VPrint(format, arguments); |
| 84 va_end(arguments); | 96 va_end(arguments); |
| 85 } | 97 } |
| 86 | 98 |
| 87 | 99 |
| 88 void PrintF(FILE* out, const char* format, ...) { | 100 void PrintF(FILE* out, const char* format, ...) { |
| 89 va_list arguments; | 101 va_list arguments; |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 420 } |
| 409 if (u.bits.exp == 0) { | 421 if (u.bits.exp == 0) { |
| 410 // Detect +0, and -0 for IEEE double precision floating point. | 422 // Detect +0, and -0 for IEEE double precision floating point. |
| 411 if ((u.bits.man_low | u.bits.man_high) == 0) return false; | 423 if ((u.bits.man_low | u.bits.man_high) == 0) return false; |
| 412 } | 424 } |
| 413 return true; | 425 return true; |
| 414 } | 426 } |
| 415 | 427 |
| 416 | 428 |
| 417 } } // namespace v8::internal | 429 } } // namespace v8::internal |
| OLD | NEW |