Author: Lars Wassermann <[email protected]>
Branch:
Changeset: r307:c988d5a86694
Date: 2013-04-22 13:56 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/c988d5a86694/
Log: fixed whitespace
diff --git a/spyvm/fieldtypes.py b/spyvm/fieldtypes.py
--- a/spyvm/fieldtypes.py
+++ b/spyvm/fieldtypes.py
@@ -165,4 +165,4 @@
if start < end:
mid = partition(an_array, start, end)
sort_quick_inplace(an_array, start, mid)
- sort_quick_inplace(an_array, mid + 1, end)
\ No newline at end of file
+ sort_quick_inplace(an_array, mid + 1, end)
diff --git a/spyvm/interpreter.py b/spyvm/interpreter.py
--- a/spyvm/interpreter.py
+++ b/spyvm/interpreter.py
@@ -83,7 +83,7 @@
if not jit.we_are_jitted():
self.quick_check_for_interrupt(s_context)
while True:
- pc = s_context._pc
+ pc = s_context.pc()
method = s_context.s_method()
if pc < old_pc:
if jit.we_are_jitted():
diff --git a/spyvm/objspace.py b/spyvm/objspace.py
--- a/spyvm/objspace.py
+++ b/spyvm/objspace.py
@@ -19,7 +19,7 @@
name=name[2:])
self.classtable[name] = w_class
return w_class
-
+
# A complete minimal setup (including Behavior) would look like this
#
# class: superclass: metaclass:
@@ -34,7 +34,7 @@
# ClassDescription cl Behavior class *Metaclass
# Class class ClassDescription cl *Metaclass
# Metaclass class ClassDescription cl *Metaclass
-
+
# Class Name Super class name
cls_nm_tbl = [
["w_Object", "w_ProtoObject"], # there is not
ProtoObject in mini.image
@@ -61,7 +61,7 @@
for nm, w_cls_obj in self.classtable.items():
if w_cls_obj.s_class is None:
w_cls_obj.s_class = s_Metaclass
-
+
def define_cls(cls_nm, supercls_nm, instvarsize=0,
format=shadow.POINTERS,
varsized=False):
assert cls_nm.startswith("w_")
@@ -295,7 +295,7 @@
if not w_array.getclass(self).is_same_object(self.w_Array):
raise UnwrappingError()
assert isinstance(w_array, model.W_PointersObject)
-
+
return [w_array.at0(self, i) for i in range(w_array.size())]
def get_display(self):
diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -825,7 +825,6 @@
@expose_primitive(DRAW_RECTANGLE, unwrap_spec=[object, int, int, int, int])
def func(interp, s_frame, w_rcvr, left, right, top, bottom):
- # import pdb; pdb.set_trace()
raise PrimitiveNotYetWrittenError()
diff --git a/spyvm/shadow.py b/spyvm/shadow.py
--- a/spyvm/shadow.py
+++ b/spyvm/shadow.py
@@ -18,7 +18,7 @@
can be attached at run-time to any Smalltalk object.
"""
_attr_ = ['_w_self']
-
+
def __init__(self, space, w_self):
self.space = space
self._w_self = w_self
@@ -64,7 +64,7 @@
class Version:
pass
-# ____________________________________________________________
+# ____________________________________________________________
POINTERS = 0
BYTES = 1
@@ -266,9 +266,9 @@
self._s_superclass = None
else:
s_scls = w_class.as_class_get_shadow(self.space)
- if self._s_superclass is s_scls:
+ if self._s_superclass is s_scls:
return
- elif (self._s_superclass is not None
+ elif (self._s_superclass is not None
and self._s_superclass is not s_scls):
self._s_superclass.detach_s_class(self)
self._s_superclass = s_scls
@@ -428,11 +428,11 @@
self.store(n0, self.w_self()._fetch(n0))
def copy_to_w_self(self, n0):
self.w_self()._store(n0, self.fetch(n0))
-
+
class ContextPartShadow(AbstractRedirectingShadow):
__metaclass__ = extendabletype
- _attr_ = ['_s_sender', '_pc', '_temps_and_stack',
+ _attr_ = ['_s_sender', '_pc', '_temps_and_stack',
'_stack_ptr', 'instances_w']
_virtualizable2_ = [
@@ -504,7 +504,7 @@
self.push(self.space.w_nil)
def wrap_stackpointer(self):
- return self.space.wrap_int(self.stackdepth() +
+ return self.space.wrap_int(self.stackdepth() +
self.tempsize())
def external_stackpointer(self):
@@ -515,7 +515,7 @@
def s_home(self):
return self.w_home().as_methodcontext_get_shadow(self.space)
-
+
def stackstart(self):
raise NotImplementedError()
@@ -563,6 +563,7 @@
return self._pc
def store_pc(self, newpc):
+ assert newpc >= -1
self._pc = newpc
def stackpointer_offset(self):
@@ -601,7 +602,7 @@
# Temporary Variables
#
# Are always fetched relative to the home method context.
-
+
def gettemp(self, index):
return self.s_home().gettemp(index)
@@ -619,7 +620,7 @@
# ______________________________________________________________________
# Stack Manipulation
-
+
def stack(self):
"""NOT_RPYTHON""" # purely for testing
return self._temps_and_stack[self.tempsize():self._stack_ptr]
@@ -681,7 +682,7 @@
raise NotImplementedError()
# ______________________________________________________________________
# Marriage of Context Shadows with PointerObjects only when required
-
+
def w_self(self):
if self._w_self is not None:
return self._w_self
@@ -762,7 +763,7 @@
def unwrap_store_eargc(self, w_value):
self.store_expected_argument_count(self.space.unwrap_int(w_value))
-
+
def wrap_eargc(self):
return self.space.wrap_int(self.expected_argument_count())
@@ -774,10 +775,10 @@
def initialip(self):
return self._initialip
-
+
def store_initialip(self, initialip):
self._initialip = initialip
-
+
def store_w_home(self, w_home):
assert isinstance(w_home, model.W_PointersObject)
self._w_home = w_home
@@ -824,21 +825,21 @@
s_new_context._w_self_size = size
s_new_context_non_fresh = s_new_context # XXX: find a better solution
to translation err
s_new_context = jit.hint(s_new_context, access_directly=True,
fresh_virtualizable=True)
-
- if closure is not None:
+
+ if closure is not None:
s_new_context.w_closure_or_nil = closure._w_self
-
+
s_new_context.store_w_method(s_method.w_self())
if s_sender:
s_new_context.store_s_sender(s_sender)
s_new_context.store_w_receiver(w_receiver)
s_new_context.store_pc(pc)
s_new_context.init_stack_and_temps()
-
+
argc = len(arguments)
for i0 in range(argc):
s_new_context.settemp(i0, arguments[i0])
- if closure is not None:
+ if closure is not None:
for i0 in range(closure.size()):
s_new_context.settemp(i0+argc, closure.at0(i0))
return s_new_context_non_fresh
@@ -870,7 +871,7 @@
return self.settemp(temp_i, w_value)
else:
return ContextPartShadow.store(self, n0, w_value)
-
+
@jit.dont_look_inside
def attach_shadow(self):
# Make sure the method and closure_or_nil are updated first,
@@ -884,7 +885,7 @@
if not self.is_closure_context():
return self.s_method().tempsize()
else:
- return wrapper.BlockClosureWrapper(self.space,
+ return wrapper.BlockClosureWrapper(self.space,
self.w_closure_or_nil).tempsize()
def w_method(self):
@@ -927,7 +928,7 @@
def returnTopFromMethod(self, interp, current_bytecode):
if self.is_closure_context():
# this is a context for a blockClosure
- w_outerContext = self.w_closure_or_nil.fetch(self.space,
+ w_outerContext = self.w_closure_or_nil.fetch(self.space,
constants.BLKCLSR_OUTER_CONTEXT)
assert isinstance(w_outerContext, model.W_PointersObject)
s_outerContext = w_outerContext.as_context_get_shadow(self.space)
@@ -1008,7 +1009,7 @@
if self.literals:
# (Blue book, p 607) All CompiledMethods that contain
# extended-super bytecodes have the clain which they are found as
- # their last literal variable.
+ # their last literal variable.
# Last of the literals is an association with compiledin
# as a class
w_association = self.literals[-1]
diff --git a/spyvm/wrapper.py b/spyvm/wrapper.py
--- a/spyvm/wrapper.py
+++ b/spyvm/wrapper.py
@@ -170,7 +170,7 @@
class SchedulerWrapper(Wrapper):
priority_list = make_getter(0)
active_process, store_active_process = make_getter_setter(1)
-
+
def get_process_list(self, priority):
lists = Wrapper(self.space, self.priority_list())
@@ -178,9 +178,9 @@
def highest_priority_process(self):
w_lists = self.priority_list()
- # Asserts as W_PointersObjectonion in the varnish.
+ # Asserts as W_PointersObjectonion in the varnish.
lists = Wrapper(self.space, w_lists)
-
+
for i in range(w_lists.size() - 1, -1, -1):
process_list = ProcessListWrapper(self.space, lists.read(i))
if not process_list.is_empty_list():
@@ -222,7 +222,7 @@
x, store_x = make_int_getter_setter(0)
y, store_y = make_int_getter_setter(1)
-
+
class BlockClosureWrapper(VarsizedWrapper):
outerContext, store_outerContext =
make_getter_setter(constants.BLKCLSR_OUTER_CONTEXT)
startpc, store_startpc = make_int_getter_setter(constants.BLKCLSR_STARTPC)
@@ -242,13 +242,13 @@
return w_new_frame
def tempsize(self):
- # We ignore the number of temps a block has, because the first
- # bytecodes of the block will initialize them for us. We will only
- # use this information for decinding where the stack pointer should be
+ # We ignore the number of temps a block has, because the first
+ # bytecodes of the block will initialize them for us. We will only
+ # use this information for decinding where the stack pointer should be
# initialy.
# For a finding the correct number, see BlockClosure>#numTemps in an
Image.
return self.size() + self.numArgs()
-
+
def size(self):
return self._w_self.size() - constants.BLKCLSR_SIZE
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit