1. Pypy
  2. Untitled project
  3. lang-js

Commits

stepahn  committed f558b5d

removed dead code

  • Participants
  • Parent commits 1ea7366
  • Branches default

Comments (0)

Files changed (4)

File js/jscode.py

View file
  • Ignore whitespace
         if self.has_labels:
             self.remove_labels()
 
-    def unpop_or_undefined(self):
-        if not self.unpop():
-            self.emit('LOAD_UNDEFINED')
-        #elif not self.returns():
-            #self.emit('LOAD_UNDEFINED')
-
-    def to_function_opcodes(self):
         self.unlabel()
-        #self.unpop()
-        #self.unpop#_or_undefined()
-        #self.emit('LOAD_UNDEFINED')
-        return self.opcodes
-
-    def to_eval_opcodes(self):
-        self.unlabel()
-        #self.unpop#_or_undefined()
-        return self.opcodes
-
-    def to_global_opcodes(self):
-        self.unlabel()
-        #self.unpop#_or_undefined()
-        return self.opcodes
-
-    def to_executable_opcodes(self):
-        self.unlabel()
-        #self.unpop#_or_undefined()
-        return self.opcodes
 
     def remove_labels(self):
         """ Basic optimization to remove all labels and change

File js/operations.py

View file
  • Ignore whitespace
 
 class EmptyExpression(Expression):
     def emit(self, bytecode):
-        #bytecode.unpop_or_undefined()
         bytecode.emit('LOAD_UNDEFINED')
 
 

File js/utils.py

View file
  • Ignore whitespace
 
     def _set_stack_pointer(self, p):
         self._stack_pointer_ = p
-
-    #@jit.unroll_safe
-    def _stack_pop_n(self, n):
-        l = [None] * n
-        for i in range(n - 1, -1, -1):
-            l[i] = self._stack_pop()
-        #debug.make_sure_not_resized(l)
-        return l

File test/test_stack.py

View file
  • Ignore whitespace
         s.append(3)
         assert s.top() == 3
 
-    def test_stack_popn(self):
-        s = Stack(99)
-        s.append(1)
-        s.append(2)
-        s.append(3)
-        x = s.pop_n(2)
-        assert x == [2, 3]
-        assert s._stack_pointer_ == 1
-        assert s._stack_[1] is None
-        assert s._stack_[2] is None
-
     def test_stack_no_resize(self):
         s = Stack(2)
         s.append(1)