| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 {%- endif -%} | 129 {%- endif -%} |
| 130 {%- endmacro -%} | 130 {%- endmacro -%} |
| 131 | 131 |
| 132 | 132 |
| 133 {%- macro long_char_create() -%} | 133 {%- macro long_char_create() -%} |
| 134 {%- if encoding == 'utf16'-%} | 134 {%- if encoding == 'utf16'-%} |
| 135 const uint32_t long_char = primary_char; | 135 const uint32_t long_char = primary_char; |
| 136 {%- elif encoding == 'utf8'-%} | 136 {%- elif encoding == 'utf8'-%} |
| 137 unsigned bytes_read = 0; | 137 unsigned bytes_read = 0; |
| 138 const uint32_t long_char = unibrow::Utf8::CalculateValue( | 138 const uint32_t long_char = unibrow::Utf8::CalculateValue( |
| 139 reinterpret_cast<uint8_t*>(cursor_), | 139 reinterpret_cast<const uint8_t*>(cursor_), |
| 140 buffer_end_ - cursor_, | 140 buffer_end_ - cursor_, |
| 141 &bytes_read); | 141 &bytes_read); |
| 142 cursor_ += bytes_read - 1; | 142 cursor_ += bytes_read - 1; |
| 143 if (long_char == unibrow::Utf8::kBadChar) goto default_action; | 143 if (long_char == unibrow::Utf8::kBadChar) goto default_action; |
| 144 {%- else -%} | 144 {%- else -%} |
| 145 uncompilable code for {{encoding}} | 145 uncompilable code for {{encoding}} |
| 146 {%- endif -%} | 146 {%- endif -%} |
| 147 {%- endmacro -%} | 147 {%- endmacro -%} |
| 148 | 148 |
| 149 | 149 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 FORWARD(); | 311 FORWARD(); |
| 312 goto code_start; | 312 goto code_start; |
| 313 | 313 |
| 314 fell_through: | 314 fell_through: |
| 315 ((void(*)())0)(); // crash | 315 ((void(*)())0)(); // crash |
| 316 // force use of stored_token | 316 // force use of stored_token |
| 317 stored_token = Token::ILLEGAL; | 317 stored_token = Token::ILLEGAL; |
| 318 } | 318 } |
| 319 } } | 319 } } |
| 320 | 320 |
| OLD | NEW |