| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1726 | 1726 |
| 1727 | 1727 |
| 1728 void HeapNumber::HeapNumberPrint(StringStream* accumulator) { | 1728 void HeapNumber::HeapNumberPrint(StringStream* accumulator) { |
| 1729 // The Windows version of vsnprintf can allocate when printing a %g string | 1729 // The Windows version of vsnprintf can allocate when printing a %g string |
| 1730 // into a buffer that may not be big enough. We don't want random memory | 1730 // into a buffer that may not be big enough. We don't want random memory |
| 1731 // allocation when producing post-crash stack traces, so we print into a | 1731 // allocation when producing post-crash stack traces, so we print into a |
| 1732 // buffer that is plenty big enough for any floating point number, then | 1732 // buffer that is plenty big enough for any floating point number, then |
| 1733 // print that using vsnprintf (which may truncate but never allocate if | 1733 // print that using vsnprintf (which may truncate but never allocate if |
| 1734 // there is no more space in the buffer). | 1734 // there is no more space in the buffer). |
| 1735 EmbeddedVector<char, 100> buffer; | 1735 EmbeddedVector<char, 100> buffer; |
| 1736 OS::SNPrintF(buffer, "%.16g", Number()); | 1736 SNPrintF(buffer, "%.16g", Number()); |
| 1737 accumulator->Add("%s", buffer.start()); | 1737 accumulator->Add("%s", buffer.start()); |
| 1738 } | 1738 } |
| 1739 | 1739 |
| 1740 | 1740 |
| 1741 String* JSReceiver::class_name() { | 1741 String* JSReceiver::class_name() { |
| 1742 if (IsJSFunction() && IsJSFunctionProxy()) { | 1742 if (IsJSFunction() && IsJSFunctionProxy()) { |
| 1743 return GetHeap()->function_class_string(); | 1743 return GetHeap()->function_class_string(); |
| 1744 } | 1744 } |
| 1745 if (map()->constructor()->IsJSFunction()) { | 1745 if (map()->constructor()->IsJSFunction()) { |
| 1746 JSFunction* constructor = JSFunction::cast(map()->constructor()); | 1746 JSFunction* constructor = JSFunction::cast(map()->constructor()); |
| (...skipping 15207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16954 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16954 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16955 static const char* error_messages_[] = { | 16955 static const char* error_messages_[] = { |
| 16956 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16956 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16957 }; | 16957 }; |
| 16958 #undef ERROR_MESSAGES_TEXTS | 16958 #undef ERROR_MESSAGES_TEXTS |
| 16959 return error_messages_[reason]; | 16959 return error_messages_[reason]; |
| 16960 } | 16960 } |
| 16961 | 16961 |
| 16962 | 16962 |
| 16963 } } // namespace v8::internal | 16963 } } // namespace v8::internal |
| OLD | NEW |