push method

void push(
  1. int value
)

Implementation

void push(int value) {
  //ref 6.3.3
  if (_max > 0 && length == (_max - 1)) {
    throw GameException('Stack Overflow. $_max');
  }
//
//    if (length % 1024 == 0){
//      Debugger.debug('stack at $length');
//      Debugger.debug('text buffer: ${Z.sbuff}');
//    }

  //excluding the stack boundary flag
  if (value < 0 && value != Engine.stackMarker) {
    value = MathHelper.dartSignedIntTo16BitSigned(value);
  }

  stack.insert(0, value);
}