Revision: 18610
Author:   [email protected]
Date:     Wed Jan 15 09:31:26 2014 UTC
Log:      Experimental parser: elide cursor reads in some cases

[email protected]

BUG=

Review URL: https://codereview.chromium.org/139303002
http://code.google.com/p/v8/source/detail?r=18610

Modified:
 /branches/experimental/parser/tools/lexer_generator/code_generator.jinja
 /branches/experimental/parser/tools/lexer_generator/code_generator.py

=======================================
--- /branches/experimental/parser/tools/lexer_generator/code_generator.jinja Wed Jan 15 09:00:41 2014 UTC +++ /branches/experimental/parser/tools/lexer_generator/code_generator.jinja Wed Jan 15 09:31:26 2014 UTC
@@ -205,7 +205,9 @@

   {{ write_label('state_entry', node_number_chain) }}

-  READ_CURSOR();
+  {% if not state['can_elide_read'] -%}
+    READ_CURSOR();
+  {%- endif -%}

   {% if debug_print %}
     fprintf(stderr,
=======================================
--- /branches/experimental/parser/tools/lexer_generator/code_generator.py Tue Jan 14 10:36:59 2014 UTC +++ /branches/experimental/parser/tools/lexer_generator/code_generator.py Wed Jan 15 09:31:26 2014 UTC
@@ -99,6 +99,7 @@
       'node_number' : None,
       'original_node_number' : state.node_number(),
       'transitions' : transitions,
+      'can_elide_read' : len(transitions) == 0,
       'switch_transitions' : [],
       'deferred_transitions' : [],
       'long_char_transitions' : [],
@@ -286,6 +287,9 @@
         state['match_action'] = (state['match_action'][0], value)
         if state['match_action'][0] != 'goto_start':
           states[value[-1]]['entry_points']['after_entry_code'] = True
+          state['can_elide_read'] = False
+        else:
+          states[value[-1]]['can_elide_read'] = False

   @staticmethod
   def __mark_entry_points(dfa_states):

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to