[pypy-commit] lang-smalltalk default: renamed the new primitives to their interpreterVM equivalents
lwassermann
noreply at buildbot.pypy.org
Wed Feb 20 10:44:20 CET 2013
Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch:
Changeset: r64:ce77fd4f5f06
Date: 2013-02-20 10:40 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/ce77fd4f5f06/
Log: renamed the new primitives to their interpreterVM equivalents
diff --git a/spyvm/interpreter.py b/spyvm/interpreter.py
--- a/spyvm/interpreter.py
+++ b/spyvm/interpreter.py
@@ -370,7 +370,7 @@
self.pop()
# closure bytecodes
- def pushNewArrayPopIntoArray(self, interp):
+ def pushNewArrayBytecode(self, interp):
arraySize, popIntoArray = splitter[7, 1](self.getbytecode())
newArray = None
if popIntoArray == 1:
@@ -388,19 +388,19 @@
w_indirectTemps = self.gettemp(index_of_array)
return index_in_array, w_indirectTemps
- def pushTempAtInTempVectorAt(self, interp):
+ def pushRemoteTempLongBytecode(self, interp):
index_in_array, w_indirectTemps = self._extract_index_and_temps()
self.push(w_indirectTemps.at0(self.space, index_in_array))
- def storeTempAtInTempVectorAt(self, interp):
+ def storeRemoteTempLongBytecode(self, interp):
index_in_array, w_indirectTemps = self._extract_index_and_temps()
w_indirectTemps.atput0(self.space, index_in_array, self.top())
- def popAndStoreTempAtInTempVectorAt(self, interp):
+ def storeAndPopRemoteTempLongBytecode(self, interp):
index_in_array, w_indirectTemps = self._extract_index_and_temps()
w_indirectTemps.atput0(self.space, index_in_array, self.pop())
- def pushClosureNumCopiedNumArgsBlockSize(self, interp):
+ def pushClosureCopyCopiedValuesBytecode(self, interp):
""" Copied from Blogpost: http://www.mirandabanda.org/cogblog/2008/07/22/closures-part-ii-the-bytecodes/
ContextPart>>pushClosureCopyNumCopiedValues: numCopied numArgs: numArgs blockSize: blockSize
"Simulate the action of a 'closure copy' bytecode whose result is the
@@ -572,12 +572,12 @@
(135, "popStackBytecode"),
(136, "duplicateTopBytecode"),
(137, "pushActiveContextBytecode"),
- (138, "pushNewArrayPopIntoArray"),
+ (138, "pushNewArrayBytecode"),
(139, "experimentalBytecode"),
- (140, "pushTempAtInTempVectorAt"),
- (141, "storeTempAtInTempVectorAt"),
- (142, "popAndStoreTempAtInTempVectorAt"),
- (143, "pushClosureNumCopiedNumArgsBlockSize"),
+ (140, "pushRemoteTempLongBytecode"),
+ (141, "storeRemoteTempLongBytecode"),
+ (142, "storeAndPopRemoteTempLongBytecode"),
+ (143, "pushClosureCopyCopiedValuesBytecode"),
(144, 151, "shortUnconditionalJump"),
(152, 159, "shortConditionalJump"),
(160, 167, "longUnconditionalJump"),
diff --git a/spyvm/test/test_interpreter.py b/spyvm/test/test_interpreter.py
--- a/spyvm/test/test_interpreter.py
+++ b/spyvm/test/test_interpreter.py
@@ -831,7 +831,7 @@
option.bc_trace = bc_trace
# Closure Bytecodes
-def test_bc_pushNewArrayPopIntoArray(bytecode=pushNewArrayPopIntoArray):
+def test_bc_pushNewArrayBytecode(bytecode=pushNewArrayBytecode):
interp = new_interpreter(bytecode + chr(0x83))
context = interp.s_active_context()
context.push(fakeliterals(space, "egg"))
@@ -843,7 +843,7 @@
assert array.at0(space, 1) == fakeliterals(space, "bar")
assert array.at0(space, 2) == fakeliterals(space, "baz")
-def test_bc_pushNewArray(bytecode=pushNewArrayPopIntoArray):
+def test_bc_pushNewArray(bytecode=pushNewArrayBytecode):
interp = new_interpreter(bytecode + chr(0x07))
context = interp.s_active_context()
interp.step(interp.s_active_context())
@@ -851,7 +851,7 @@
assert array.size() == 7
assert array.at0(space, 0) == space.w_nil
-def test_pushTempAt0InTempVectorAt0(bytecode = pushTempAtInTempVectorAt):
+def test_bc_pushRemoteTempLongBytecode(bytecode = pushRemoteTempLongBytecode):
interp = new_interpreter(bytecode + chr(0) + chr(0))
context = interp.s_active_context()
context.push(fakeliterals(space, "jam"))
@@ -871,21 +871,21 @@
interp.step(context)
return context, temp_array
-def test_pushTempAt3InTempVectorAt1(bytecode = pushTempAtInTempVectorAt):
+def test_bc_pushRemoteTempLongBytecode2(bytecode = pushRemoteTempLongBytecode):
context, _ = setupTempArrayAndContext(bytecode)
assert context.top() == fakeliterals(space, "pub")
-def test_storeTempAtInTempVectorAt(bytecode = storeTempAtInTempVectorAt):
+def test_bc_storeRemoteTempLongBytecode(bytecode = storeRemoteTempLongBytecode):
context, temp_array = setupTempArrayAndContext(bytecode)
assert context.top() == fakeliterals(space, "bar")
assert temp_array.at0(space, 2) == fakeliterals(space, "bar")
-def test_popAndStoreTempAtInTempVectorAt(bytecode = popAndStoreTempAtInTempVectorAt):
+def test_bc_storeAndPopRemoteTempLongBytecode(bytecode = storeAndPopRemoteTempLongBytecode):
context, temp_array = setupTempArrayAndContext(bytecode)
assert temp_array.at0(space, 2) == fakeliterals(space, "bar")
assert context.top() == fakeliterals(space, "english")
-def test_pushClosureNumCopied0NumArgsBlockSize(bytecode = pushClosureNumCopiedNumArgsBlockSize):
+def test_bc_pushClosureCopyCopied0ValuesBytecode(bytecode = pushClosureCopyCopiedValuesBytecode):
for i in (0, 0xF0, 0x0FF0, 0xFFF0):
interp = new_interpreter(bytecode + chr(2) + chr(i >> 8) + chr(i & 0xFF))
context = interp.s_active_context()
@@ -897,7 +897,7 @@
assert closure.startpc() == pc + 4
assert closure.outerContext() is context._w_self
-def test_pushClosureNumCopied2NumArgsBlockSize(bytecode = pushClosureNumCopiedNumArgsBlockSize):
+def test_bc_pushClosureCopyCopied2ValuesBytecode(bytecode = pushClosureCopyCopiedValuesBytecode):
interp = new_interpreter(bytecode + chr(0x23) + chr(0) + chr(0))
context = interp.s_active_context()
context.push("english")
diff --git a/spyvm/todo.txt b/spyvm/todo.txt
--- a/spyvm/todo.txt
+++ b/spyvm/todo.txt
@@ -22,5 +22,3 @@
Shadows:
[ ] Fix invalidation of methoddictshadow when the w_self of its values array changes
-Lars ToDo
-[ ] different image with BlockClosure instead of BlockContext
More information about the pypy-commit
mailing list