Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: tools/lexer_generator/code_generator.jinja

Issue 139303002: Experimental parser: elide cursor reads in some cases (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/lexer_generator/code_generator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 {% endmacro -%} 198 {% endmacro -%}
199 199
200 200
201 {%- macro do_dfa_state(node_number_chain) -%} 201 {%- macro do_dfa_state(node_number_chain) -%}
202 202
203 {%- set node_number = node_number_chain|first -%} 203 {%- set node_number = node_number_chain|first -%}
204 {%- set state = dfa_states[node_number] -%} 204 {%- set state = dfa_states[node_number] -%}
205 205
206 {{ write_label('state_entry', node_number_chain) }} 206 {{ write_label('state_entry', node_number_chain) }}
207 207
208 READ_CURSOR(); 208 {% if not state['can_elide_read'] -%}
209 READ_CURSOR();
210 {%- endif -%}
209 211
210 {% if debug_print %} 212 {% if debug_print %}
211 fprintf(stderr, 213 fprintf(stderr,
212 "state {{state.node_number}}, start %d, cursor %d\n", 214 "state {{state.node_number}}, start %d, cursor %d\n",
213 start_ - buffer_, 215 start_ - buffer_,
214 cursor_ - buffer_); 216 cursor_ - buffer_);
215 {% endif -%} 217 {% endif -%}
216 218
217 {%- set entry_action = state.entry_action -%} 219 {%- set entry_action = state.entry_action -%}
218 {%- if entry_action %} 220 {%- if entry_action %}
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // force use of stored_token 346 // force use of stored_token
345 stored_token = Token::ILLEGAL; 347 stored_token = Token::ILLEGAL;
346 // force use of marker 348 // force use of marker
347 marker = NULL; 349 marker = NULL;
348 // force use of state_entry_0 350 // force use of state_entry_0
349 goto state_entry_0; 351 goto state_entry_0;
350 } 352 }
351 } 353 }
352 } } 354 } }
353 355
OLDNEW
« no previous file with comments | « no previous file | tools/lexer_generator/code_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698