📄 frame.c
字号:
/*0001*//*
/*0002./ * Copyright (c) 1998-2001 Sun Microsystems, Inc. All Rights Reserved.
/*0003./ *
/*0004./ * This software is the confidential and proprietary information of Sun
/*0005./ * Microsystems, Inc. ("Confidential Information"). You shall not
/*0006./ * disclose such Confidential Information and shall use it only in
/*0007./ * accordance with the terms of the license agreement you entered into
/*0008./ * with Sun.
/*0009./ *
/*0010./ * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
/*0011./ * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
/*0012./ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
/*0013./ * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
/*0014./ * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
/*0015./ * THIS SOFTWARE OR ITS DERIVATIVES.
/*0016./ *
/*0017./ */
/*0018*/
/*0019*//*=========================================================================
/*0020./ * SYSTEM: KVM
/*0021./ * SUBSYSTEM: Interpreter stack frames
/*0022./ * FILE: frame.c
/*0023./ * OVERVIEW: This file defines the internal operations for
/*0024./ * manipulating stack frames & performing exception
/*0025./ * handling.
/*0026./ * AUTHOR: Antero Taivalsaari, Sun Labs
/*0027./ * Edited by Doug Simon 11/1998 (simplified exception handling)
/*0028./ * Sheng Liang (chunky stacks), Frank Yellin
/*0029./ *=======================================================================*/
/*0030*/
/*0031*//*=========================================================================
/*0032./ * Include files
/*0033./ *=======================================================================*/
/*0034*/
/*0035*/#include <global.h>
/*0036*/
/*0037*//*=========================================================================
/*0038./ * Global variables and definitions
/*0039./ *=======================================================================*/
/*0040*/
/*0041*//* Shortcuts to the errors/exceptions that the VM may throw */
/*0042*/
/*0043*/const char NullPointerException[]
/*0044*/ = "java/lang/NullPointerException";
/*0045*/const char IndexOutOfBoundsException[]
/*0046*/ = "java/lang/IndexOutOfBoundsException";
/*0047*/const char ArrayIndexOutOfBoundsException[]
/*0048*/ = "java/lang/ArrayIndexOutOfBoundsException";
/*0049*/const char ArrayStoreException[]
/*0050*/ = "java/lang/ArrayStoreException";
/*0051*/const char ArithmeticException[]
/*0052*/ = "java/lang/ArithmeticException";
/*0053*/const char ClassCastException[]
/*0054*/ = "java/lang/ClassCastException";
/*0055*/const char NegativeArraySizeException[]
/*0056*/ = "java/lang/NegativeArraySizeException";
/*0057*/
/*0181*//*=========================================================================
/*0182./ * Operations on stack frames
/*0183./ *=======================================================================*/
/*0184*/
/*0185*//*=========================================================================
/*0186./ * FUNCTION: pushFrame()
/*0187./ * TYPE: constructor (kind of)
/*0188./ * OVERVIEW: Creates a new execution stack frame for the currently
/*0189./ * executing thread. The operation is used for invoking
/*0190./ * methods upon message sending to objects.
/*0191./ * INTERFACE:
/*0192./ * parameters: method pointer
/*0193./ * returns: TRUE if pushFrame succeeds;
/*0194./ * FALSE on stack overflow (it will have raised the exception)
/*0195./ *
/*0196./ * COMMENTS: Note: this function operates in the context of
/*0197./ * currently executing thread. All VM registers must
/*0198./ * be initialized correctly before allocating frames.
/*0199./ *
/*0200./ * Remember that the zeroeth local variable '*lp'
/*0201./ * must contain the 'this' (self) pointer
/*0202./ * in virtual/special/interface function calls.
/*0203./ *=======================================================================*/
/*0204*/
/*0205*/bool_t pushFrame(METHOD thisMethod)
/*0206*/{
/*0207*/ int thisFrameSize = thisMethod->frameSize; //\\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -