Commits

Hakan Ardo committed 572208c Merge

merge

Comments (0)

Files changed (2)

pypy/jit/metainterp/optimizeopt/unroll.py

 
             virtual_state = self.initial_virtual_state
             values = [self.getvalue(arg) for arg in exported_state.jump_args]
-            virtual_state = virtual_state.make_guarded_generalization_of(exported_state.generalize_virtual_state,
+            virtual_state = virtual_state.make_guardable_generalization_of(exported_state.generalize_virtual_state,
                                                                  exported_state.jump_args,
                                                                  self.optimizer)
             values = [self.getvalue(arg) for arg in exported_state.jump_args]            

pypy/jit/metainterp/optimizeopt/virtualstate.py

     def generalization_of(self, other, renum, bad):
         raise NotImplementedError
 
-    def make_guarded_generalization_of(self, other, value, optimizer):
+    def make_guardable_generalization_of(self, other, value, optimizer):
         pass
 
     def generate_guards(self, other, box, cpu, extra_guards, renum):
 
         return True
 
-    def make_guarded_generalization_of(self, other, value, optimizer):
+    def make_guardable_generalization_of(self, other, value, optimizer):
         if not self._generalization_of(other):
             raise InvalidLoop
         assert isinstance(other, AbstractVirtualStructStateInfo)
         for i in range(len(self.fielddescrs)):
             if other.fielddescrs[i] is not self.fielddescrs[i]:
                 raise InvalidLoop
-            new_field_value = self.fieldstate[i].make_guarded_generalization_of(other.fieldstate[i],
+            new_field_value = self.fieldstate[i].make_guardable_generalization_of(other.fieldstate[i],
                                                                         value.getfield(self.fielddescrs[i], None),
                                                                         optimizer)
             if new_field_value:
             return False
         return True
 
-    def make_guarded_generalization_of(self, other, value, optimizer):
+    def make_guardable_generalization_of(self, other, value, optimizer):
         if not self.generalization_of(other, {}, {}):
             box = value.get_key_box()
             try:
                 self._generate_guards(other, box, optimizer.cpu, [])
-                return 
+                return # It is enough if we can generate guards to make states compatibe
             except InvalidLoop:
                 pass
             if isinstance(box, Const):
                 return False
         return True
 
-    def make_guarded_generalization_of(self, other, jumpargs, optimizer):
+    def make_guardable_generalization_of(self, other, jumpargs, optimizer):
         assert len(self.state) == len(other.state) == len(jumpargs)
         values = [optimizer.getvalue(arg) for arg in jumpargs]
         for i in range(len(self.state)):
-            new_value = self.state[i].make_guarded_generalization_of(other.state[i], values[i], optimizer)
+            new_value = self.state[i].make_guardable_generalization_of(other.state[i], values[i], optimizer)
             if new_value:
                 optimizer.make_equal_to(jumpargs[i], new_value, True)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.