def configure_stream(self, stream): stream.big_endian = self.is_big_endian if self.is_64bit: if not system.IS_64BIT: raise error.FatalError("Cannot handle 64-bit image.") stream.be_64bit() else: stream.be_32bit()
def _extendedStoreBytecode(self, interp, current_bytecode, descriptor): variableType, variableIndex = self._extendedVariableTypeAndIndex( descriptor) if variableType == 0: self.w_receiver().store(self.space, variableIndex, self.top()) elif variableType == 1: self.settemp(variableIndex, self.top()) elif variableType == 2: raise error.FatalError( "Illegal ExtendedStoreBytecode. veriableType 2.") elif variableType == 3: w_association = self.w_method().getliteral(variableIndex) association = wrapper.AssociationWrapper(self.space, w_association) association.store_value(self.top())
def unwind_context_chain(self, start_context, target_context, return_value): if start_context is None: # This is the toplevel frame. Execution ended. raise ReturnFromTopLevel(return_value) assert target_context context = start_context while context is not target_context: if not context: msg = "Context chain ended while trying to return\n%s\nfrom\n%s\n(pc %s)\nto\n%s\n(pc %s)" % ( return_value.as_repr_string(), start_context.short_str(), start_context.pc(), target_context.short_str(), start_context.pc()) raise error.FatalError(msg) s_sender = context.s_sender() context._activate_unwind_context(self) context = s_sender context.push(return_value) return context