OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 buffer_[position_] = '\0'; | 90 buffer_[position_] = '\0'; |
91 // Make sure nobody managed to add a 0-character to the | 91 // Make sure nobody managed to add a 0-character to the |
92 // buffer while building the string. | 92 // buffer while building the string. |
93 ASSERT(strlen(buffer_.start()) == static_cast<size_t>(position_)); | 93 ASSERT(strlen(buffer_.start()) == static_cast<size_t>(position_)); |
94 position_ = -1; | 94 position_ = -1; |
95 ASSERT(is_finalized()); | 95 ASSERT(is_finalized()); |
96 return buffer_.start(); | 96 return buffer_.start(); |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 const DivMagicNumbers DivMagicNumberFor(int32_t divisor) { | |
101 switch (divisor) { | |
102 case 3: return DivMagicNumberFor3; | |
103 case 5: return DivMagicNumberFor5; | |
104 case 7: return DivMagicNumberFor7; | |
105 case 9: return DivMagicNumberFor9; | |
106 case 11: return DivMagicNumberFor11; | |
107 case 25: return DivMagicNumberFor25; | |
108 case 125: return DivMagicNumberFor125; | |
109 case 625: return DivMagicNumberFor625; | |
110 default: return InvalidDivMagicNumber; | |
111 } | |
112 } | |
113 | |
114 } } // namespace v8::internal | 100 } } // namespace v8::internal |
OLD | NEW |