KR100649799B1 - Method and apparatus for implementing fast subclass and subtype checks - Google Patents
Method and apparatus for implementing fast subclass and subtype checks Download PDFInfo
- Publication number
- KR100649799B1 KR100649799B1 KR1019990009588A KR19990009588A KR100649799B1 KR 100649799 B1 KR100649799 B1 KR 100649799B1 KR 1019990009588 A KR1019990009588 A KR 1019990009588A KR 19990009588 A KR19990009588 A KR 19990009588A KR 100649799 B1 KR100649799 B1 KR 100649799B1
- Authority
- KR
- South Korea
- Prior art keywords
- type
- class
- sub
- candidate
- computer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/465—Distributed object oriented systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/449—Object-oriented method invocation or resolution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
프로그램 실행 중(中)에 신속하게 서브-타입 검사(fast subtype check)를 실행하는 방법(method)과 장치(apparatus)를 발표한다. 본 발명의 하나의 특징에 따라서, 객체를 바탕으로 하는 컴퓨팅 시스템(object-based computing system)의 일부분이 되는 객체와 관련이 있는 클래스(class)가 또 하나 타입(type)의 서브-타입(subtype)인지를 결정하는 방법은, 객체와 연관성이 있는 클래스와 관련이 있는 동적(動的) 스토리지 위치(dynamic storage location)에서 후보 타입(candidate type)을 얻는 단계, 그리고 후보 타입(candidate type)과 같을 가능성이 있는 제 1 타입(first type)에 대하여 후보 타입(candidate type)을 비교하는 단계 등을 포함한다. 그 다음에, 후보 타입(candidate type)이 실질적으로 제 1 타입(first type)과 일치하는지에 관하여 결정을 한다. 후보 타입(candidate type)이 실질적으로 제 1 타입(first type)과 일치한다고 결정을 할 때, 후보 타입(candidate type)이 제 1 타입(first type)의 서브-타입(subtype)이라는 것에 대한 표시(indication)를 공급한다. 하나의 실시예(實施例)에 있어서, 동적(動的) 스토리지 위치에서 얻어진 후보 타입(candidate type)이, 객체와 관련이 있는 클래스에 있는 캐시 요소(cache element)에서 얻어진다.We present a method and an apparatus for performing fast subtype checks during program execution. According to one aspect of the invention, a class associated with an object that is part of an object-based computing system is another type of subtype. The method of determining acknowledgment may include obtaining a candidate type at a dynamic storage location associated with a class associated with the object, and possibly the same as a candidate type. And comparing a candidate type with respect to the first type. Next, a determination is made as to whether the candidate type substantially matches the first type. When determining that the candidate type substantially matches the first type, an indication that the candidate type is a subtype of the first type ( supply indications. In one embodiment, the candidate type obtained at the dynamic storage location is obtained from a cache element in the class associated with the object.
Description
본 발명은 하기 도면을 참조하여 설명된다. The invention is illustrated with reference to the following figures.
도 1 은, 종래의 클래스 분류 체계(conventional class hierarchy)의 대표 그림을 나타낸다 ; 1 shows a representative picture of a conventional class hierarchy;
도 2a 는, 본 발명의 실시예에 따라서, 한 객체가 특정 타입의 서브-타입(subtype)인지를 결정하는 것과 관련이 있는 단계를 나타내는 처리 순서도를 나타낸다 ; FIG. 2A shows a processing flow diagram illustrating the steps involved in determining whether an object is a subtype of a particular type, in accordance with an embodiment of the present invention; FIG.
도 2b 는, 본 발명의 실시예에 따라서, 적재된 캐시(loaded cache)에 대하여 타입(type)을 비교하는 것과 관련이 있는 단계, 예를 들면, 도 2a 의 단계(208)를 나타내는 처리 순서도를 나타낸다 ; FIG. 2B illustrates a process flow diagram illustrating steps involved in comparing a type against a loaded cache, eg,
도 2c 는, 본 발명의 실시예에 따라서, 캐시 요소(cache element)를 갖는 한 클래스(class)의 대표 그림을 나타낸다 ; 2C shows a representative picture of a class with cache elements, in accordance with an embodiment of the invention;
도 3 는, 본 발명을 구현하는데 적합한 컴퓨터 시스템(computer system)의 대표 그림을 나타낸다 ; 그리고 3 shows a representative picture of a computer system suitable for implementing the present invention; And
도 4 는, 본 발명의 실시예에 따라서, 가상 기계(virtual machine)의 대표 그림을 나타낸다.4 shows a representative picture of a virtual machine, in accordance with an embodiment of the invention.
* 참조 번호 설명* Reference Number Description
9102 : 클래스 구조(class structure)9102 class structure
202 : 객체가 타입"B"의 서브-타입(subtype)인지를 결정하는 방법202: How to determine if an object is a subtype of type "B"
330 : 컴퓨터 시스템(computer system)330: computer system
405 : 컴파일-시간 환경(compile-time environment)405 compile-time environment
435 : 실행-시간 환경(runtime environment)435 run-time environment
440 : 가상 기계(virtual machine)440 virtual machine
본 발명은 일반적으로 객체를 바탕으로 하는(객체 지향) 시스템(object-based system)내 객체들 사이의 관계를 결정하는 것에 관한 것이다. 보다 더 상세하게, 본 발명은 객체를 바탕으로 하는 시스템(object-based system)내 객체들에 대한 서브-타입 검사(subtype check)를 효율적으로 실행하는 것에 관한 것이다.The present invention generally relates to determining relationships between objects in an object-based system. More particularly, the present invention relates to the efficient execution of subtype checks on objects in an object-based system.
객체들이 특정 클래스(class)와 서브-클래스(sub-class) 등의 일부가 되도록 객체를 바탕으로 하는 많은 컴퓨팅 시스템(computing system)을 구축되는 데, 이러한 클래스(class)와 서브-클래스(sub-class) 등은 객체에 대하여 이용 가능한 기능을 정의한다. 프로그램 실행 중에, 일반적으로 가상 기계(virtual machine)는 프로그램의 실행을 쉽게 하도록 객체들 사이의 관계를 검사(check)한다. 일례로, 가상 기계(virtual machine)는 서브-클래스(sub-class), 서브-타입(subtype), 또는 객체들 사이의 관계를 검사할 수 있다. 캘리포니아에 있는 Palo Alto 의 Sun Microsystems, Inc 에 의하여 개발된 JavaTM 프로그래밍 언어와 같은, 어떤 프로그래밍 언어에 있어서, 프로그래밍 언어 내에 서브-클래스 검사(sub-class check)를 포함한다. 이러한 서브-클래스 검사는 일반적으로 특정 객체가 정해진 타입을 가지는지에 대한 결정을 포함한다. 즉, 특정 객체의 타입을 결정하도록 프로그램과 관련이 있는 클래스 구조가 검사된다.Many computing systems based on objects are built so that objects become part of a particular class and sub-class, etc. These classes and sub-classes class) defines the functions available for an object. During program execution, a virtual machine typically checks the relationships between objects to facilitate the execution of a program. In one example, a virtual machine may check the relationship between sub-classes, subtypes, or objects. For some programming languages, such as the JavaTM programming language developed by Sun Microsystems, Inc. of Palo Alto, California, includes a sub-class check in the programming language. Such sub-class checking generally involves determining whether a particular object has a given type. That is, the class structure associated with a program is examined to determine the type of a particular object.
도 1 은, 종래의 클래스 구조(conventional class structure)의 대표 그림을 나타낸다. 클래스 구조(102)(class structure), 예를 들면, 클래스 분류 체계(class hierarchy)는 클래스(106)(class)와 서브-클래스(110)(sub-class) 등을 포함한다. 일반적으로, 클래스(106)(class)는 다수의 서브-클래스(110)를 포함할 수 있는 추상적 클래스(abstract class)이다. 도 1 에서 나타난 것처럼, 서브-클래스"1"(110a), 서브-클래스"2"(110b), 및 서브-클래스"N"(110c) 등은 클래스(106)의 "직접(direct)" 서브-클래스이며, 서브-클래스"A1"(110d)은 서브-클래스"1"(110a)의 직접 서브-클래스이다. 서브-클래스"A1"(110d)이 클래스(106)의 서브-클래스가 되는 서브-클래스"1"(110a)의 서브-클래스이기 때문에, 서브-클래스"A1"(110d)은 클래스(106)의 간접 클래스(indirect class)라 할 수 있다.1 shows a representative picture of a conventional class structure. The
클래스(106)는 일반적으로 다양한 서로 다른 함수 기능(function), 또는 방법(method)을 포함한다. 각각의 서브-클래스(110)는 서로 다른 세트의 함수 기능을 포함한다. 한 예로서, 서브-클래스"1"(110a)은 이러한 클래스의 한 부분이 되는 객체들에 특정한 함수 기능을 포함할 것이다. 클래스(106)의 멤버가 되는 한 객체는 실질적으로 클래스(106)와 관련이 있는 모든 함수 기능을 실행 할수 있다. 또한, 서브-클래스(110) 한 멤버가 되는 객체는, 클래스(106)의 멤버가 된다. 이와 같이, 또한, 서브-클래스(110) 중에서 어떤 서브-클래스의 멤버가 되는 객체는, 클래스(106)와 관련이 있는 함수 기능을 실행할 수 있다. 하지만, 특정 서브-클래스, 예를 들면, 서브-클래스"1"(110a)의 멤버가 되는 객체는, 이러한 클래스와는 다른 서브-클래스, 예를 들면, 서브-클래스"2"(110b)와 관련이 있는 특정 함수 기능을 수행 하지 못한다. 그러므로 객체가 어떤 서브-클래스(110)에 속하는지에 대한 결정은, 그 같은 객체가 실행할 수 있는 함수 기능을 결정한다.
서브-클래스"1"(110a)에 의하여 정의되는 객체로써 클래스(106)에 의하여 정의되는 객체를 효율적으로 나타낼 목적으로, 프로그램이 실행되는 시간(runtime)에 한정된 예상(narrowing cast)을 이용할 수 있다. 하지만, 클래스(106)에 의하여 정의되는 객체는 서브-클래스"1"(110a)에 의하여서가 아닌 서브-클래스"2"(110b)에 의하여 정의될 수 있기 때문에, 서브-클래스"1"(110a)과 관련이 있는 객체가 정확한지를 결정할 목적으로, 한 검사가 실행된다. 당업자에게 잘 알려진 바와 같이, 객체가 서브-클래스"1"(110a)과 관련이 있는지에 관한 검사는, 객체는 서브-클래스"1"(110a)과 적어도 관련이 있음을 결정하는 검사로써 효율적이다. 달리 말하면, 서브-클래스"A1"(110d)과 관련이 있는 객체는, 또한 서브-클래스"1"(110a)과 관련이 있는 것으로 일반적으로 결정될 것이다.For the purpose of efficiently representing the object defined by
JavaTM 환경에서, 객체의 서브-타입, 예를 들면, is_subtype 함수기능의 서브타입을 결정하는 한 함수 기능은 정적으로 인코딩(encoding)된다. 상기 함수 기능을 정적으로 인코딩(encoding)하는데 이용되는 방법은 다양할 수 있지만, 통상적으로 이용되는 하나의 방법은 2 차원의 비트 매트릭스(two-dimensional bit matrix)의 이용을 포함하는데, 여기서 (i,j)에 의하여 정의되는 위치에서의 한 비트는 is_subtype(ti,tj)의 결과를 인코딩(encoding)한다. 이러한 매트릭스를 이용하여, 서브-타입 검사(subtype check)는 객체의 서브-타입을 결정하는데 매트릭스로의 인덱싱(indexing)을 효율적으로 포함한다. 하지만, 매트릭스의 크기는 실질적으로 중요하고, 서브-타입 검사는 때때로 일반적으로 요구되는 명령의 비트 조정으로 인하여 느려진다.In the JavaTM environment, a function function is statically encoded as long as it determines the sub-type of the object, for example the subtype of the is_subtype function function. The method used to statically encode the functional function may vary, but one commonly used method involves the use of a two-dimensional bit matrix, where (i, One bit at the position defined by j) encodes the result of is_subtype (ti, tj). Using this matrix, subtype checks effectively include indexing into the matrix to determine the sub-type of the object. However, the size of the matrix is practically important, and sub-type checking is sometimes slowed down due to bit adjustment of the commonly required instructions.
일반적으로, 서브-타입 검사를 할 때, 타입의 실질적인 모든 서브-타입, 예를 들면, 한 클래스의 실질적인 모든 서브-클래스가, 특정 객체의 서브-타입을 결정하는데 검사되어야 한다. 어떤 분류 체계적인 클래스 구조에 있어서, 예를 들면, 도 1 에서의 클래스 구조(102)에 있어서, 검사되어야만 하는 서브-클래스의 숫자는 상대적으로 크다. 일례로서, 어떤 클래스는 수 백개의 관련된 서브-클래스를 가질 수 있다. 이와 같이, JavaTM 프로그래밍 언어에서 정의되는 인터페이스와 관련이 있는 경우에서와 같이, 다수의 서브-타입이 이용 가능할 때, 서브-타입 검사의 구현은 때때로 효율적이지 않다고 입증된다. 즉, 다수의 서브-타입이 이용 가능할 때, 위에서 기술된 것처럼, 각각의 서브-타입을 검사하는 것은 일반적으로 시간을 낭비한다. 추가로, 다수의 전승 층(inheritance layers)을 이용하는 시스템에 있어서, 예를 들면, C++ 프로그래밍 언어에 의하여 정의되는 시스템에 있어서, 서브-타입 검사를 구현하는 것은 또한 때때로 효율적이지 않다. 다수의 전승 층을 갖춘 시스템에 대하여, 전승된 각각의 층이 검사되어야 하기 때문에, 서브-타입 검사(subtype check)가 효율적으로 실시된다는 것이 사실상 어렵다.In general, when doing sub-type checking, substantially all sub-types of the type, for example, substantially all of the sub-classes of one class, should be checked to determine the sub-type of a particular object. In some taxonomy class structures, for example, in the
효율적인 서브-타입 검사의 실시는, 검사가 빈번하게 일어나기 때문에 중요하다. 프로그램의 실행 중에 검사가 빈번하게 일어날 때, 검사와 관련이 있는 오버헤드(overhead)는 상대적으로 크다. 어떤 경우에 있어서, 당업자가 알 수 있는 것처럼, 실행 시간 서브 타입 검사, 또는 시험은 대략 8 개의 명령을 필요로 하는 데, 이는 특히 만약 실행 시간 서브타입 검사가 반복적으로 일어난다면, 전체 프로그램에 심각해질 수 잇는 문제가 된다. 그러므로 빈번하게 일어나는 서브-타입 검사에 의하여, 프로그램이 실행되는 속도를 떨어뜨린다.The implementation of efficient sub-type checks is important because checks occur frequently. When checks occur frequently during program execution, the overhead associated with checks is relatively large. In some cases, as will be appreciated by those skilled in the art, runtime subtype checking, or testing, requires approximately eight instructions, particularly if the runtime subtype checking occurs repeatedly, which would be severe for the entire program. This can be a problem. Therefore, the frequent sub-type checking slows down the execution of the program.
일반적으로, 프로그램의 실행 중에 서브-타입을 검사할 때, 프로그램과 관련이 있는 실질적인 모든 클래스와 방법 등은 공지되어 있다. 데이터 구조는 자주 프로그램과 관련이 있는 모든 클래스와 방법 등을 나열하도록 구성됨으로써, 클래스와 방법이 쉽게 접근 가능하도록 한다. 달리 말하면, 상기 데이터 구조는 상대적으로 크고, 중요한 시스템 자원을 낭비한다. 또한 프로그램과 관련이 있는 모든 클래스와 방법이 공지되어야 한다는 요구 사항은, 동적 연결, 또는 동적 클래스 적재를 이용하는 시스템과 호환 가능하지 않은데, 이는 동적 연결에 의하여 프로그램과 관련이 있는 클래스와 방법이 효율적으로 변환되도록 하기 때문이다. 따라서 프로그램의 기능이 동적 연결을 사용하지 못함으로 인해 떨어지게 된다. 동적 연결(dynamic linking)을 이용하는 환경에서, 클래스 적재를 포함하는 모든 동작이 있은 후에 상기 데이터 구조들이 다시 계산되는데, 이러한 것은 시간 낭비이고, 따라서 효율적이지 못하다.In general, when checking sub-types during execution of a program, virtually all classes and methods associated with the program are known. The data structure is often organized to list all the classes and methods associated with the program, making the classes and methods easily accessible. In other words, the data structure is relatively large and wastes valuable system resources. In addition, the requirement that all classes and methods associated with a program be known is not compatible with systems that use dynamic linking, or dynamic class loading, in which case the classes and methods that are associated with a program can be efficiently This is because it is converted. As a result, the program's functionality is compromised by the lack of dynamic linking. In an environment using dynamic linking, the data structures are recalculated after all operations involving class loading, which is a waste of time and thus not efficient.
그러므로, 요구되어지는 것은 서브-타입 검사(subtype check)가 발생하는 때 효율을 개선시키는 방법과 장치 등이다. 보다 더 상세하게, 정말로 요구되어지는 것은, 클래스 적재 동작(class loading operation)이 일어날 때마다 데이터 구조(data structure)를 다시 계산할 필요 없이, 서브-타입 검사(subtype check)를 효율적으로 실행하는 방법과 장치 등이다.Therefore, what is required is a method and apparatus for improving the efficiency when subtype checks occur. More specifically, what is really needed is a method of efficiently performing subtype checks without having to recalculate the data structure each time a class loading operation occurs. Device and the like.
프로그램 실행 중에 신속하게 서브-타입 검사(fast subtype check)를 실행하는 방법과 장치를 발표한다. 본 발명의 하나의 특징에 따라서, 객체를 바탕으로 하는(객체 지향) 컴퓨팅 시스템(object-based computing system)의 부분인 객체와 관련이 있는 타입을 신속하게 효율적으로 결정하는 방법(method)은, 객체와 연관성이 있는 클래스와 관련이 있는 동적 스토리지 위치(dynamic storage location)에서 후보 타입(candidate type)을 얻는 단계, 그리고 후보 타입(candidate type)과 같을 가능성이 있는 제 1 타입(first type)에 대하여 후보 타입(candidate type)을 비교하는 단계를 포함한다. 그 다음에, 후보 타입(candidate type)이 실질적으로 제 1 타입(first type)과 일치하는지에 관하여 결정을 한다. 후보 타입(candidate type)이 실질적으로 제 1 타입(first type)과 일치한다고 결정을 할 때, 후보 타입(candidate type)이 제 1 타입(first type)과 일차한 다는 표시(indication)를 제공한다.We present a method and device for performing fast subtype checks during program execution. In accordance with one aspect of the present invention, a method for quickly and efficiently determining the type associated with an object that is part of an object-based computing system includes: Obtaining a candidate type at a dynamic storage location associated with the class associated with the candidate and for a first type that is likely to be the same as the candidate type. Comparing the type (candidate type). Next, a determination is made as to whether the candidate type substantially matches the first type. When determining that the candidate type substantially matches the first type, an indication is provided that the candidate type is primary with the first type.
본 발명의 하나의 특징에 따라서, 컴퓨터 시스템(computer system)이 컴퓨터 시스템에서 존재하는 제 1 객체와 관련이 있는 타입(type)을 결정하도록 된다. 이러한 컴퓨터 시스템은 프로세서(processor), 메모리, 후보 타입을 메모리로 적재하도록 하는 적재 메커니즘(loading mechanism) 을 포함한다. 후보 타입은 제 1 객체와 관련이 있는 클래스 객체로부터 얻어진다. 상기 컴퓨터 시스템은 또한 제 1 타입에 대하여 후보 타입(candidate type)을 비교하도록 하는 비교 메커니즘(comparison mechanism), 그리고 후보 타입이 제 1 타입과 실질적으로 일치하는지를 결정하도록 하는 결정 메커니즘(determination mechanism) 을 포함한다. 상기 컴퓨터 시스템 내 한 표시기(indicator)가 제공되어, 후보 타입이 실질적으로 제 1 타입과 일치한다고 결정할 때, 후보 타입이 제 1 타입과 일치한 다는 표시(indication)를 제공하도록 한다. In accordance with one aspect of the present invention, a computer system is adapted to determine a type associated with a first object present in the computer system. Such computer systems include a processor, memory, and loading mechanisms for loading candidate types into memory. The candidate type is obtained from the class object associated with the first object. The computer system also includes a comparison mechanism for comparing a candidate type against a first type, and a determination mechanism for determining whether the candidate type substantially matches the first type. do. An indicator in the computer system is provided to provide an indication that the candidate type matches the first type when determining that the candidate type substantially matches the first type.
본 발명의 또 하나의 특징에 따라서, 특정 클래스의 멤버(member)가 되는 객체에 대한 서브-타입 검사(subtype check)를 실행하는 방법이, 특정 클래스와 관련이 있는 위치로부터 한 저장된 요소(stored element)를 얻음을 포함한다. 상기 저장된 요소(stored element)는 객체와 관련이 있을 가능성이 있는 제 1 서브-타입과 연관성이 있는 정보를 포함한다. 또한, 상기 방법은, 저장된 요소에 포함된 정보가 객체와 연관성이 있는 실제 서브-타입(actual subtype)과 관련이 있다고 결정하는 단계, 그리고 상기 저장된 요소와 실제 서브-타입이 관련이 있을 때, 상기 저장된 요소에 포함된 정보가 실제 서브-타입과 관련이 있다는 표시(indication)를 제공하는 단계를 포함한다. 하나의 실시예에 있어서, 상기 방법은, 또한, 상기 저장된 요소에 포함된 정보가 실제 서브-타입과 관련이 없을 때, 상기 객체의 실제 서브-타입을 결정하는 단계, 그리고 특정 클래스와 연관성이 있는 위치로 상기 실제 서브-타입과 관련이 있는 정보를 저장하는 단계를 포함한다.In accordance with another aspect of the invention, a method of performing subtype checks on an object that is a member of a particular class includes a stored element from a location associated with the particular class. Includes; The stored element includes information associated with a first sub-type that may be associated with an object. In addition, the method may further comprise determining that the information contained in the stored element is related to an actual subtype associated with an object, and when the stored element is related to the actual sub-type, Providing an indication that the information contained in the stored element is related to the actual sub-type. In one embodiment, the method further comprises: determining the actual sub-type of the object when the information contained in the stored element is not related to an actual sub-type, and which is associated with a particular class. Storing information relating to the actual sub-type to a location.
하기에서는 첨부 도면을 참조하여 본원 발명을 상세하게 설명한다. Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.
일반적으로, 객체들 사이의 서브-타입 관계(subtype relationship)를 결정하기 위하여 실행되는 서브-타입 검사(subtype check)는 컴퓨터 메모리 공간의 상당한 양을 필요로 한다. 이 같은 공간은 서브-타입 검사(subtype check)를 실행하는 것과 관련이 있는 명령을 위해, 그리고 컴퓨터 프로그램의 실행과 관련이 있는 모든 타입과 방법을 저장하는데 자주 이용되는 미리 계산된 데이터 구조(pre-computed data structure)를 위해 필요로 된다. 되풀이되는 서브-타입 검사를 실행하기 위하여 필요로 하는 오버헤드(overhead)에 추가하여, 서브-타입 검사(subtype check)를 위하여 필요로 하는 공간은 프로그램을 실행하는 속도를 자주 떨어뜨리게 된다. In general, subtype checks performed to determine subtype relationships between objects require a significant amount of computer memory space. This space is a pre-computed data structure that is often used for instructions that involve performing subtype checks, and for storing all types and methods that involve the execution of computer programs. computed data structure). In addition to the overhead required to run recurring sub-type checks, the space required for subtype checks often slows down the execution of the program.
서브-타입 검사의 예상되는 결과를 저장하는 것에 의하여, 서브-타입 검사를 실행하는 것과 관련이 있는 오버헤드(overhead)의 양이 효과적으로 감소된다. 특히, 프로그램이 실행 시, 한 객체와 관련이 있는 서브-타입이 처음 한 특정 타입에 대하여 검사하여 지게 되는 때, 상기 실제 검사는 당업자에게 잘 알려져 있는 어떠한 방법을 이용하여도 실시 될 수 있다. 같은 클래스의 객체에 대한 뒤따르는 검사는 같은 서브-타입 결과를 가지기 때문에, 실제 검사의 결과를 저장하는 것, 예를 들면, 제 1 검사의 컴퓨터 계산에 의한 결과를 저장하는 것에 의하여, 서브-타입 검사를 실행하는 것과 관련이 있는 오버헤드(overhead)는 눈에 뜨이게 줄어들도록 할 수 있다. 달리 말하면, 같은 검사에 있어서, 캐쉬(caching)를 사용하는 동적 서브타입 검사 메카니즘은 이전의 서브타입 검사 결과가 캐쉬될 수 있도록 하여, 만약 상기 캐쉬 값이 올바른 값, 즉 적절한 것으로 결정된다면 상기 캐쉬 값이 사용될 수 있도록 함으로써 상기 같은 검사가 뒤에 수행되는 때 같은 검사의 속도를 높일 수 있도록 한다. 하나의 실시예에 있어서, 고속처리를 위하여 저장된 데이터인 캐쉬 데이터(cached data)가 검사되고 있는 객체에 대한 타입 기술어(type descriptor)로서 사용, 유지될 수 있다. By storing the expected result of the sub-type check, the amount of overhead associated with performing the sub-type check is effectively reduced. In particular, when a program is executed, when a sub-type associated with an object is first checked for a particular type, the actual check can be performed using any method well known to those skilled in the art. Subsequent checks on objects of the same class have the same sub-type results, so storing the result of the actual check, for example by storing the result of the computer calculation of the first check, The overhead associated with running the test can be noticeably reduced. In other words, for the same check, a dynamic subtype check mechanism that uses caching allows previous subtype check results to be cached, so that if the cache value is determined to be the correct value, i. This can be used to speed up the same test when the same test is performed later. In one embodiment, cached data, which is stored data for high-speed processing, may be used and maintained as a type descriptor for the object being inspected.
한 클래스와 관련이 있는, 객체"s"의 서브-타입을 결정하는 초기의 검사가 실행된 후에, 초기 검사의 결과는 저장된다. 초기 서브-타입 검사의 결과를 저장하는 것에 의하여, 객체"s"의 서브-타입을 결정하는 검사를 필요로 하는 다음 번에, 상기 저장된 결과는 같은 서브-타입 검사가 보다 더 빠르게 진행되어 지도록 한다. 실례에 의하여, 객체"s"의 서브-타입이 타입"T"에 대하여 검사될 때, 즉, 객체"s"가 특정 서브-타입"T"인 지에 관하여 결정을 할 때, 객체"s"와 관련이 있는 저장된 타입 기술어(stored type descriptor)와 서브-타입"T" 사이에서 상대적으로 빠른 비교가 있게 된다. 객체"s"의 타입이 서브-타입"T"와 같을 때, 비교는 성공적인 것으로 판단되고, 종래의 서브-타입 검사는 필요하지 않다. 그러므로 종래의 서브-타입 검사와 관련이 있는 오버헤드가 피하여 질 수 있다. 선택에 따라, 객체"s"의 타입이 서브-타입"T"에 일치하지 않을 때, 종래의 서브-타입 검사가 객체"s"의 타입을 결정하는데 이용될 수 있다. 어떤 경우에 있어서, 이러한 검사는, 클래스 분류 체계를 횡단하여 적합한 서브타입을 찾도록 함을 포함하며, 그리고 적합한 서브-타입을 찾을 수 없을 때 예외를 제기하는 것을 포함할 수 있다.After the initial check that determines the sub-type of the object "s", which is associated with a class, is performed, the result of the initial check is stored. By storing the result of the initial sub-type check, the next time the check requires a sub-type of the object "s", the stored result causes the same sub-type check to proceed more quickly. . By way of example, when the sub-type of object "s" is checked against type "T", that is, when determining whether object "s" is a particular sub-type "T", There is a relatively fast comparison between the associated stored type descriptor and the sub-type "T". When the type of the object "s" is equal to the sub-type "T", the comparison is determined to be successful and conventional sub-type checking is not necessary. Therefore, the overhead associated with conventional sub-type checking can be avoided. Optionally, when the type of the object "s" does not match the sub-type "T", conventional sub-type checking can be used to determine the type of the object "s". In some cases, this check may include traversing the class classification scheme to find a suitable subtype, and may include raising an exception when a suitable sub-type cannot be found.
도 2a 에서, 객체가 특정 타입의 서브-타입 또는 서브-클래스인지를 결정하는 것과 관련이 있는 단계가 본 발명의 실시예에 따라 기술될 것이다. 특히, 객체가 타입"B"의 서브-타입인지를 결정하는 처리가 설명될 것이다. 객체가 타입"B"의 서브-타입(subtype)인지를 결정하는 방법(202)(process)은 단계(204)에서 시작하는데, 객체의 타입, 예를 들면, 객체의 클래스는 컴퓨터 시스템과 관련이 있는 레지스터로 적재된다. 당업자에게 알려져 있는 것처럼, 객체 전체 클래스, 예를 들면, 객체의 추상 클래스(abstract class)가 알려져 있다. 상기 객체의 클래스가 일단 레지스터로 적재되면, 단계(206)에서 적재된 클래스(loaded class)의 캐시 요소(cache element)가, 예를 들면, 컴퓨터의 메모리로 적재된다. 캐시 요소나 캐시 등은 도 2c 와 관하여 기술될 것이다.In FIG. 2A, the steps involved in determining whether an object is a sub-type or sub-class of a particular type will be described according to an embodiment of the present invention. In particular, the process of determining whether an object is a sub-type of type "B" will be described. The
상기 캐시가 적재된 후에, 타입 B 가 단계(208)에서 상기 적재된 캐시에 대하여 비교된다. 적재된 캐시와 타입 B 를 비교하는 것과 관련이 있는 단계는 도 2b 에 관하여 아래에서 기술될 것이다. 적재된 캐시에 대하여 타입 B 의 비교에 대한 결과에 관하여, 단계(210)에서 결정을 한다. 기술된 실시예에 있어서, 타입 B 와 적재된 캐시와의 비교의 결과가 참이라면, 예를 들면, 타입 B 와 적재된 캐시가 일치된다는 비교를 결정한다면, 단계(222)에서 상기 객체가 타입 B 의 서브-타입인지에 대한 결정을 요구하였던 함수로 참 값이 리턴(return)된다. 달리 말하면, 적재된 클래스와 타입 B 가 동일한 클래스라면, 또는 적재된 클래스가 타입 B 의 서브-타입이라면, 참 값이 리턴(return)된다. 일단 참 값이 리턴(return)되면, 객체가 타입 B 인지에 대한 결정의 처리를 완성한다.After the cache is loaded, type B is compared against the loaded cache at
선택적으로, 단계(210)에서 적재된 캐시에 대하여 타입 B 의 비교가 참 결과를 공급하지 않는다고 결정한다면, 객체의 클래스와 타입 B 사이에서 서브-타입 관계(subtype relationship)는 단계(212)에서 완성된다. 즉, 객체의 클래스와 타입 B 가 같지 않다고 결정할 때, 객체의 클래스와 타입 B 사이에서 어떤 관계가 있다면 그 관계를 결정하는 컴퓨터에 의한 계산을 실행한다. 서브-타입 관계가 완성된 후에, 처리 흐름은 단계(214)로 진행되는데, 서브-타입에 대한 계산이 참 결과를 일으키는지에 관하여, 즉, 객체의 클래스와 타입 B 사이의 서브-타입 관계가 유효한지에 관하여, 단계(214)에서 결정을 내린다.Optionally, if it is determined in
객체의 클래스와 타입 B 사이에서 서브-타입 관계가 존재하지 않는다고 단계(214)에서 결정한다면, 단계(220)에서 거짓 값을 서브-타입 검사를 요구하였던 함수로 리턴(return)한다. 거짓 값을 일단 리턴(return)한다면, 객체가 타입 B 의 서브-타입인지를 결정하는 처리는 완성된다. 하지만, 객체의 클래스와 타입 B 사이에서 서브-타입이 존재한다고 단계(214)에서 결정한다면, 처리의 흐름은 단계(216)로 진행되는데, 단계(216)에서 객체에 있는 클래스의 캐시(cache)는 클래스 B 로 "채워진다". 달리 말하면, 클래스 B, 또는 타입 B 에 대한 참조(reference) 가 상기 객체의 클래스 캐시 요소내로 저장된다. 마지막으로, 객체의 클래스 캐시가 타입 B 로 채워진 후에, 객체의 클래스와 타입 B 사이에서 서브-타입 관계가 있다는 것을 나타내도록, 단계(218)에서 참 값이 시스템으로 리턴(return)된다. 그 다음에, 객체가 타입 B 의 서브-타입인지를 결정하는 처리는 완성된다.If it is determined at
이제, 도 2b 에서, 타입 B 를 적재된 캐시(loaded cache), 예를 들면, 특정 객체의 클래스에 대하여 비교하는 단계가 본 발명의 실시예에 따라서 기술될 것이다. 즉, 도 2a 에 있는 단계(208)의 하나의 실시예가 논의될 것이다. 적재된 캐시에 대하여 타입 B 의 비교는 단계(232)에서 시작하는데, 캐시 요소(cache element)가 레지스터(register)로 적재된다. 특히, 도 2c 와 관련하여 아래에서 기술될 것이지만, 객체의 클래스 캐시 요소가 레지스터로 적재된다. 캐시 요소를 레지스터로 적재시킨 후에, 레지스터에 있는 내용이 단계(234)에서 타입 B 에 비교된다. 위에서 논의된 것처럼, 캐쉬(cashing)를 사용하는 검사 메카니즘은 이전의 서브 타입 검사 결과가 캐쉬될 수 있도록 하여, 동일한 검사가 뒤에 수행되는 때 상기 캐쉬된 값이 사용될 수 있도록 하여 동일한 검사를 고속처리 할 수 있도록 한다. 검사에서 캐쉬 요소가 사용될 수 있도록 함으로써, 상기 캐쉬 요소는 용이하게 접근될 수 있다. 캐시 요소와 레지스터에 있는 내용을 비교하기 위한 적합한 방법이 이용될 수 있으며, 일반적으로, 당업자에 의해 이러한 방법은 공지되어 있다. 레지스터의 내용이 타입 B 에 일단 비교되면, 적재된 캐시에 대하여 타입 B 를 비교하는 처리는 완성된다.In FIG. 2B, the step of comparing Type B against a loaded cache, eg, a class of a particular object, will be described according to an embodiment of the present invention. That is, one embodiment of
앞에서 논의된 것처럼, 클래스, 예를 들면, 한 클래스 객체가 캐시 요소를 포함하는데, 이전에 있었던 서브-타입 검사의 결과가 저장된다. 도 2c 는, 본 발명의 실시예에 따른 캐시 요소(cache element)를 갖는 클래스(class)의 대표 그림을 나타낸다. 객체"S"(252)는 헤더(256)(header)를 포함하고, 클래스(260)에 대한 클래스 포인터를 가진다. 클래스(260)는 헤더(264)(header)와 캐시 요소(268)(cache element)를 포함한다. 앞에서 기술된 것처럼, 캐시 요소(268)는 이전에 있었던, 예를 들면, 클래스(260)와 관련이 있는 제 1, 서브-타입 검사의 결과를 저장하도록 설치된다. 클래스(260)를 초기화할 때, 캐시 요소(268)가 어떤 값으로 초기화된다. 한 예로서, 캐시 요소(268)는 클래스(260)를 확인할 수 있도록 초기화될 수 있다. 일반적으로, 프로그램을 실행할 때, 또는 보다 더 상세하게 서브-타입 검사를 실행할 때, 캐시 요소(268)에 저장된 결과는 변화될 수 있기 때문에, 캐시 요소(268)는 "동적" 저장 요소로써 고려될 수 있다. 즉, 캐시 요소(268)의 내용은 갱신될 수 있다.As discussed above, a class, for example a class object, contains a cache element, which stores the result of a previous sub-type check. 2C shows a representative picture of a class with cache elements in accordance with an embodiment of the invention. Object "S" 252 includes a
객체"s"(252)를 포함하는 서브-타입 검사 중에, 객체"s"(252)가 클래스(260)의 멤버(member)인 것으로 알려지는 때, 캐쉬 요소(268)가 접근되어 클래스(260)를 포함하는 가장 최근의 서브-타입 검사의 결과를 얻을 수 있다. 일반적으로, 클래스(260)를 포함하는 가장 최근의 서브-타입 검사 결과를 저장하도록, 캐시 요소(268)가 갱신될 수 있다. 이와 같이, 캐시 요소(268)에 저장된 결과가 객체"s"(252)와 관련이 있는 서브-타입이 아니라면, 일단 결정이 된 객체"s"(252)와 관련이 있는 실제 서브-타입이 캐시 요소(268)에 저장될 수 있다. 어떤 실시 예에 있어서, 캐시 요소(268)에 정보를 저장하고, 또한 정보를 회수하는 것은, 일어날 수 있는 캐시 부착 문제(cache coherency issue)를 처리하기 위한 동기화를 포함한다.During sub-type checking that includes object "s" 252, when object "s" 252 is known to be a member of
도 3 은, 본 발명을 구현하는데 적합한 전형적인 범용 컴퓨터 시스템을 설명하고 있다. 컴퓨터 시스템(330)(computer system)은 일정 숫자의 프로세서(332)(processor)를 포함하는데, 메모리 장치에 결합되어 있는 중앙 처리 장치(central processing units, CPUs)라고 불리는 일정 수의 처리기(332)를 포함한다. 상기 메모리 장치(memory device)는 RAM 과 같은 제 1 스토리지 장치(334)(primary storage device), 그리고 ROM 과 같은 제 1 스토리지 장치(336)(primary storage device) 를 포함한다.3 illustrates a typical general purpose computer system suitable for implementing the present invention.
컴퓨터 시스템(330), 또는 보다 더 상세하게 CPUs(332)는 가상 기계(virtual machine)를 지원하도록 설치될 수 있다. 컴퓨터 시스템에서 지원되는 가상 기계의 한 실례는, 도 4 와 관련하여 아래에서 기술될 것이다. 당해 기술에서 공지된 것처럼, ROM(336)은 CPUs(332)로 데이터와 명령을 한쪽 방향으로 전달하도록 작동하고, RAM(334)은 CPUs 에서 또는 CPUs 로 데이터와 명령을 양쪽 방향으로 전달하도록 작동한다. 제 1 스토리지 장치(334, 336) 는 모두 실질적으로 어떤 적합하게 이용되는 컴퓨터에 의하여 판독 가능한 매체(computer-readable media)를 포함한다. 일반적으로 매스 메모리 장치(mass memory device)가 되는 제 2 스토리지 매체(338)(secondary storage medium)는 양 방향으로 CPUs 에 또한 결합될 수 있다. 일반적으로, 제 2 스토리지 매체(338)는 추가의 데이터 스토리지 용량을 공급하도록 설치되고, 컴퓨터 코드를 포함하는 프로그램, 컴퓨터 프로그램 코드 장치, 데이터, 및 유사 장치 등을 저장할 수 있도록 이용되는 컴퓨터에 의하여 판독 가능한 매체(computer-readable medium)로써 제 2 스토리지 매체(338)는 될 수 있다. 일반적으로, 제 2 스토리지 매체(338)는 제 1 스토리지 장치(334, 336)보다 더 늦을 수 있는 하드디스크나 테이프 등과 같은 스토리지 매체가 된다. 자기 테이프 판독기(magnetic tape reader)와 페이퍼 테이프 판독기(paper tape reader) 등을 포함하는, 이러한 것에 제한되지는 않지만, 공지된 장치의 형(型)을, 제 2 스토리지 매체(338)는 취할 수 있다. 적합한 경우에 있어서, 제 2 스토리지 매체(338) 내에서 존속되는 정보는 가상 메모리(virtual memory)와 같은 RAM(334)의 부분으로써 표준 형(型)으로 합체될 수 있다. CD-ROM 과 같은 특별한 제 1 스토리지 장치(334)는 CPUs(332)와 한쪽 방향으로 데이터를 교환할 수 있다.
비디오 모니터, 트랙 볼, 마우스, 키보드, 마이크로폰, 접촉에 의한 디스플레이, 트랜스듀서 카드 판독기, 자기나 페이퍼 테이프 판독기, 타블릿, 스타일러스, 음성이나 손에 의하여 기록되는 인식 장치, 그리고 다른 컴퓨터와 같은 공지된 입력 장치 등을 포함하는, 하지만 이러한 것에 제한되지는 않고, 하나 이상의 입력/출력 장치(340)(input/output device)에, CPUs(332)가 결합될 수 있다. 마지막으로, (312)에서 나타난 것과 같은 네트워크 연결을 이용하여, 인터넷 네트워크(internet network)나 인트라넷 네트워크(intranet network) 등과 같은 컴퓨터 네트워크(computer network)나 원격 통신 네트워크(telecommunication network) 등에, CPUs(332)는 선택적으로 결합될 수 있다. 상기 네트워크 연결(312)(network connection)에 있어서, CPUs(332)는 네트워크(network)에서 정보를 수신할 수 있다는 것을 고려할 수 있다. 또한, CPUs(332)는 위에서 기술된 방법 단계를 실행하는 과정에서 네트워크로 정보를 출력할 수 있다. CPUs(332)를 이용하여 실행되는 일련의 명령으로써 대표되는 상기 정보는, 예를 들면, 반송파로 구현되는 컴퓨터 데이터 신호의 형태로 네트워크에서 수신될 수 있고 네트워크로 출력될 수 있다. 위에서 기술된 장치와 기술 등은, 컴퓨터 하드웨어와 컴퓨터 소프트웨어 등에 종사하는 당해 기술자에 공지되어 있다.Known inputs such as video monitors, trackballs, mice, keyboards, microphones, touch-sensitive displays, transducer card readers, magnetic or paper tape readers, tablets, stylus, voice or hand recorded recognition devices, and
앞에서 기술된 것처럼, 가상 기계(virtual machine)는 컴퓨터 시스템(330)에서 실행될 수 있다. 도 4 는, 도 3 에 있는 컴퓨터 시스템(330)에 의하여 지원되는, 그리고 본 발명을 구현하는데 적합한 가상 기계(virtual machine)의 대표 그림을 나타낸다. 컴퓨터 프로그램, 예를 들면, JavaTM 프로그래밍 언어로 기록된 컴퓨터 프로그램이 실행될 때, 소스 코드(410)(source code)가 컴파일-시간 환경(405)(compile-time environment) 내 컴파일러(420)(compiler)로 공급된다. 컴파일러(420)(compiler)는 소스 코드(410)(source code)를 바이트 코드(430)(byte code)로 변환한다. 일반적으로, 소스 코드(410)가 소프트웨어 개발자에 의하여 만들어지는 시간에, 소스 코드(410)는 바이트 코드(430)로 변환된다.As described above, the virtual machine may run on the
일반적으로 바이트 코드(430)는 다시 생성되거나, 다운-로드되거나, 그렇지 않으면 네트워크, 예를 들면, 도 3 의 네트워크(312)를 통하여 배급되거나, 도 3 의 제 1 스토리지(334)와 같은 스토리지 장치에 저장된다. 기술된 실시 예에 있어서, 바이트 코드(430)는 독립적인 플랫폼(platform)이다. 즉, 바이트 코드(430)는 적합한 가상 기계(440)(virtual machine)로 실행되는 어떠한 컴퓨터 시스템에서도 실행될 수 있다.In general,
바이트 코드(430)가 가상 기계(440)를 포함하는 실행-시간 환경(435)(runtime environment)으로 제공된다. 한 실시 예에서, 가상 기계는 JavaTM 이 될 수 있다. 실행-시간 환경(435)은 일반적으로 도 3 의 CPUs(332)와 같은 프로세서나 몇몇의 프로세서를 이용하여 실행될 수 있다. 가상 기계(440)는 컴파일러(442)(compiler), 인터프리터(444)(interpreter), 및 실행-시간 시스템(446)( runtime system) 을 포함한다. 바이트 코드(430)는 컴파일러(442), 그렇지 않으면 인터프리터(444)로 제공된다.
바이트 코드(430)가 컴파일러(442)로 제공된 때, 바이트 코드(430)에 포함된 방법(method)은 기계 명령어로 컴파일(compile)된다. 하나의 실시 예에서, 상기 컴파일러(442)는, 상기 방법이 막 실행될 때까지 바이트 코드(430)에 있는 방법의 컴파일(compile)을 지연시키는 저스트-인-타임 컴파일러(just-in-time compiler)이다. 바이트 코드(430)가 인터프리터(444)에 제공되는 때, 바이트 코드(430)는 인터프리터(444)내로 한 번에 한 바이트코드 씩 읽혀진다. 그 다음에, 바이트 코드 각각이 인터프리터(444)에서 읽혀질 때, 인터프리터(444)는 각각의 바이트 코드에 의하여 정의되는 동작을 실행한다. 즉, 인터프리터(444)는 바이트 코드(430)를 "기계어로 해석(interpret)"한다. 일반적으로, 인터프리터(444)는 바이트 코드(430)를 처리하고, 인터프리터(444)는 계속해서 실질적으로 바이트 코드(430)와 관련이 있는 동작을 실행한다.When
한 방법이 다른 한 방법에 의하여 불려지는 때, 또는 실행-시간 환경(435)으로부터 불려지는 때, 만약 상기 방법이 인터프릿(interpret)된다면, 실행-시간 시스템(446)은 일련의 바이트 코드(430)의 형태로 실행-시간 환경으로부터 상기 방법을 얻을 수 있으며, 이는 인터프리터(444)에 의해 직접 실행될 수 있다. 반면, 불러 들여진 상기 방법이 컴파일 되지 않은 방법이라면, 실행 시간 시스템(446)은 일련의 바이트 코드(430)의 형태로 상기 실행 시간 환경(435)으로부터 상기 방법을 얻으며, 다음에 컴파일러(442)를 작동하도록 진행된다. 그 다음에, 컴파일러(442)는 바이트 코드(430)에서 기계 명령어를 생성시키고, 결과로써 일어나는 기계 명령어는 도 3 의 CPUs(332)에 의하여 직접적으로 실행될 수 있다. 일반적으로, 기계-언어 명령어는 가상 기계(440)가 종료될 때 없어진다.When one method is called by the other, or when it is called from the run-
본 발명에 대하여 몇몇 실시예만이 기술되었지만, 본 발명의 범위나 사상에서 벗어나지 않으면서 많은 다른 형태로 본 발명은 실시될 수 있다는 사실을 이해해야만 한다. 실례로, 어떤 실시 예에 있어서, 클래스 객체(class object)는 하나 이상의 캐시 요소(cache element)를 포함할 수 있다. 클래스 객체가 하나 이상의 캐시 요소를 포함할 때, 서브-타입 검사(subtype check)의 하나 이상의 이전에 있었던 결과는 저장될 수 있다. 즉, 객체를 위한 하나 이상의 가능성이 있는 서브-타입을 저장함으로써, 하나의 캐시 요소에 저장된 서브-타입은 객체를 위한 서브-타입이 아니라고 결정된다면, 또 하나의 캐시 요소에 저장된 서브-타입을 검사할 수 있다. 클래스의 캐시 요소에 있는 서브-타입 검사의 이전에 있었던 결과를 저장하는 것에 관하여 본 발명을 기술하였지만, 이전에 있었던 결과는 캐시 요소에서 반드시 저장될 필요는 없다. 선택에 따라, 이전에 있었던 결과는 실질적으로 어떤 동적 스토리지 위치(dynamic storage location)에 저장될 수 있는데, 여기서 동적 스토리지 위치(dynamic storage location)는 서브-타입 검사 중에 접근 가능하다. 실례로, 이전에 있었던 서브-타입 검사의 결과는, 클래스와 직접적으로 관련이 없는 컴퓨터 코드의 섹션에 저장될 수 있다. 선택에 따라, 이전에 있었던 서브-타입 검사의 결과는 동적으로 전역으로 접근 가능한 테이블(dynamic, globally accessible table)에 저장될 수 있는데, 특정 클래스를 포함하는 서브-타입 검사가 실행될 수 있을 때마다 이러한 테이블에 접근 가능하다. 이러한 테이블은 특정 클래스와 직접적으로 관련이 있을 수 있다.While only a few embodiments have been described with respect to the present invention, it should be understood that the present invention may be practiced in many other forms without departing from the scope or spirit of the invention. For example, in some embodiments, a class object may include one or more cache elements. When a class object contains one or more cache elements, one or more previously result of a subtype check may be stored. That is, by storing one or more possible sub-types for an object, if it is determined that the sub-type stored in one cache element is not a sub-type for the object, the sub-type stored in another cache element is checked. can do. Although the present invention has been described in terms of storing a result that was previously a sub-type check in a cache element of a class, the previous result is not necessarily stored in the cache element. Optionally, the previous results can be stored at substantially any dynamic storage location, where the dynamic storage location is accessible during sub-type checking. By way of example, the results of a previous sub-type check may be stored in a section of computer code that is not directly related to the class. Optionally, the results of previous sub-type checks can be stored in a dynamically, globally accessible table, whenever a sub-type check containing a particular class can be run. The table is accessible. Such a table can be directly related to a particular class.
한 실시 예에서, 특정 객체가 어떤 서브-타입을 포함하는지를 결정하기 위하여 검사를 구현하는 대신에, 특정 객체가 어떤 서브-타입을 포함하지 않는다고 결정하도록 검사는 구현될 수 있다. 일반적으로, 컴퓨터 코드의 세그먼트(segment)에서, 또는 전역 테이블(global table)의 부분으로써, 상기 검사의 결과는 클래스의 캐시 요소에 저장될 수 있다. 달리 말하면, 캐시 요소는 특정 서브-타입 검사를 위하여 매칭(matching)되지 않는 서브-타입 표시(subtype designation)를 수용하도록 설치될 수 있다.In one embodiment, instead of implementing a check to determine which sub-type a particular object includes, the check may be implemented to determine that a particular object does not contain any sub-type. In general, in a segment of computer code, or as part of a global table, the results of the check may be stored in a cache element of the class. In other words, the cache element may be installed to accommodate subtype designation that does not match for a particular sub-type check.
일반적으로, 서브-타입 검사를 이용하는 명령어(instruction), 또는 작동(operation) 등은, 특별한 시스템의 요구 사항에 의존하면서 넓은 범위에서 다양할 수 있다. JavaTM 환경에서, 예를 들면, "aastore" 명령어, "checkcast" 명령어, 그리고 "instanceof" 명령어 등은 서브-타입 검사를 일반적으로 이용한다.In general, instructions or operations using sub-type checking may vary over a wide range, depending on the requirements of the particular system. In the JavaTM environment, for example, the "aastore" command, the "checkcast" command, and the "instanceof" command generally use sub-type checking.
덧붙여서, 본 발명에 따라서 서브-타입 검사를 실행하는 것과 관련이 있는 단계는 다양할 수 있다. 본 발명의 범위나 사상에서 벗어나지 않으면서, 이러한 단계는 변경되고, 다시 순서를 정하고, 추가되고, 그리고 제거된다. 실례에 의하여, 비교에 의하여 "참(true)" 표시를 나타낸다고 결정하는 것은, 비교에 의하여 "거짓(false)" 표시를 나타낸다고 결정하는 것으로 대신할 수 있다. 대신에, 클래스 객체가 하나 이상의 캐시 요소를 포함할 때, 서브-타입 검사를 실행하는 것과 관련이 있는 단계는, 서브-타입 매치(subtype match)를 찾을 때까지, 그렇지 않으면 모든 캐시 요소를 검사할 때까지, 각각의 캐시 요소를 통하여 효율적으로 순환하는 단계를 포함할 수 있다. 그러므로 본 실시 예는 실례로써 고려될 수 있고, 여기에 제한되지 않고, 그리고 본 발명은 여기에서 주어진 상세함에 제한되지 않지만, 부속된 특허청구범위와 그와 동일한 범위에 의하여 정해지는 것이다.In addition, the steps involved in performing sub-type checking in accordance with the present invention may vary. Without departing from the scope or spirit of the present invention, these steps are altered, reordered, added, and removed. By way of example, determining that a comparison indicates a "true" indication may be substituted for determining that a comparison indicates a "false" indication. Instead, when a class object contains one or more cache elements, the steps involved in performing sub-type checking are to check all cache elements until it finds a subtype match. Until it can efficiently cycle through each cache element. The present embodiment is therefore to be considered in all respects as illustrative and not restrictive, and the invention is not to be limited to the details given herein, but is to be defined by the appended claims and their equivalents.
Claims (23)
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US60/079,110 | 1998-03-23 | ||
| US9/107,224 | 1998-06-30 | ||
| US09/107,224 US6714991B1 (en) | 1998-03-23 | 1998-06-30 | Method and apparatus for implementing fast subclass and subtype checks |
| US09/107,224 | 1998-06-30 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| KR19990078103A KR19990078103A (en) | 1999-10-25 |
| KR100649799B1 true KR100649799B1 (en) | 2006-11-24 |
Family
ID=39047487
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| KR1019990009588A Expired - Fee Related KR100649799B1 (en) | 1998-03-23 | 1999-03-22 | Method and apparatus for implementing fast subclass and subtype checks |
Country Status (1)
| Country | Link |
|---|---|
| KR (1) | KR100649799B1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070271560A1 (en) * | 2006-05-18 | 2007-11-22 | Microsoft Corporation | Deploying virtual machine to host based on workload characterizations |
-
1999
- 1999-03-22 KR KR1019990009588A patent/KR100649799B1/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| KR19990078103A (en) | 1999-10-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6317869B1 (en) | Method of run-time tracking of object references in Java programs | |
| US6553565B2 (en) | Method and apparatus for debugging optimized code | |
| US6363522B1 (en) | Method and apparatus for handling exceptions as normal control flow | |
| EP0945790B1 (en) | Method and apparatus for implementing fast subclass and subtype checks | |
| US7100003B2 (en) | Method and apparatus for generating data for use in memory leak detection | |
| JP2000172512A (en) | Method and data processing system for executing byte code | |
| EP2348406B1 (en) | Endian conversion tool | |
| US20040003377A1 (en) | Converting byte code instructions to a new instruction set | |
| US7346901B2 (en) | Efficient generic code in a dynamic execution environment | |
| GB2341465A (en) | Determining the actual class of an object at run time | |
| CN100378657C (en) | Method and device for improving call speed of JAVA method | |
| US12008351B2 (en) | Modeling foreign functions using executable references | |
| US20040128661A1 (en) | Automatic data locality optimization for non-type-safe languages | |
| US20030188295A1 (en) | Method for implementing dynamic type checking | |
| KR100649799B1 (en) | Method and apparatus for implementing fast subclass and subtype checks | |
| US6654778B1 (en) | Method and apparatus for avoiding function activation and interpretation overhead for calls to selected java methods in a java virtual machine interpreter | |
| US6752836B1 (en) | Method and apparatus for high-concurrency client locking with java in a data processing system | |
| US11106522B1 (en) | Process memory resurrection: running code in-process after death | |
| Nanjekye et al. | Towards reliable memory management for Python native extensions | |
| US12399820B1 (en) | Selecting garbage collection processes | |
| US12306750B1 (en) | Selecting garbage collection processes | |
| US6996825B2 (en) | Method and apparatus for efficient object sub-typing | |
| Cutts et al. | The PamCase Machine | |
| Wilcox et al. | Mainsail implementation overview | |
| Ferreira | THE JEWEL VIRTUAL MACHINE |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PA0109 | Patent application |
St.27 status event code: A-0-1-A10-A12-nap-PA0109 |
|
| T11-X000 | Administrative time limit extension requested |
St.27 status event code: U-3-3-T10-T11-oth-X000 |
|
| P11-X000 | Amendment of application requested |
St.27 status event code: A-2-2-P10-P11-nap-X000 |
|
| P13-X000 | Application amended |
St.27 status event code: A-2-2-P10-P13-nap-X000 |
|
| R18-X000 | Changes to party contact information recorded |
St.27 status event code: A-3-3-R10-R18-oth-X000 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-3-3-R10-R13-asn-PN2301 St.27 status event code: A-3-3-R10-R11-asn-PN2301 |
|
| PG1501 | Laying open of application |
St.27 status event code: A-1-1-Q10-Q12-nap-PG1501 |
|
| A201 | Request for examination | ||
| PA0201 | Request for examination |
St.27 status event code: A-1-2-D10-D11-exm-PA0201 |
|
| R18-X000 | Changes to party contact information recorded |
St.27 status event code: A-3-3-R10-R18-oth-X000 |
|
| D13-X000 | Search requested |
St.27 status event code: A-1-2-D10-D13-srh-X000 |
|
| D14-X000 | Search report completed |
St.27 status event code: A-1-2-D10-D14-srh-X000 |
|
| E902 | Notification of reason for refusal | ||
| PE0902 | Notice of grounds for rejection |
St.27 status event code: A-1-2-D10-D21-exm-PE0902 |
|
| T11-X000 | Administrative time limit extension requested |
St.27 status event code: U-3-3-T10-T11-oth-X000 |
|
| P11-X000 | Amendment of application requested |
St.27 status event code: A-2-2-P10-P11-nap-X000 |
|
| P13-X000 | Application amended |
St.27 status event code: A-2-2-P10-P13-nap-X000 |
|
| R17-X000 | Change to representative recorded |
St.27 status event code: A-3-3-R10-R17-oth-X000 |
|
| E902 | Notification of reason for refusal | ||
| PE0902 | Notice of grounds for rejection |
St.27 status event code: A-1-2-D10-D21-exm-PE0902 |
|
| E13-X000 | Pre-grant limitation requested |
St.27 status event code: A-2-3-E10-E13-lim-X000 |
|
| P11-X000 | Amendment of application requested |
St.27 status event code: A-2-2-P10-P11-nap-X000 |
|
| P13-X000 | Application amended |
St.27 status event code: A-2-2-P10-P13-nap-X000 |
|
| T11-X000 | Administrative time limit extension requested |
St.27 status event code: U-3-3-T10-T11-oth-X000 |
|
| T12-X000 | Administrative time limit extension not granted |
St.27 status event code: U-3-3-T10-T12-oth-X000 |
|
| E701 | Decision to grant or registration of patent right | ||
| PE0701 | Decision of registration |
St.27 status event code: A-1-2-D10-D22-exm-PE0701 |
|
| PR1002 | Payment of registration fee |
St.27 status event code: A-2-2-U10-U11-oth-PR1002 Fee payment year number: 1 |
|
| GRNT | Written decision to grant | ||
| PR0701 | Registration of establishment |
St.27 status event code: A-2-4-F10-F11-exm-PR0701 |
|
| PG1601 | Publication of registration |
St.27 status event code: A-4-4-Q10-Q13-nap-PG1601 |
|
| LAPS | Lapse due to unpaid annual fee | ||
| PC1903 | Unpaid annual fee |
St.27 status event code: A-4-4-U10-U13-oth-PC1903 Not in force date: 20091118 Payment event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE |
|
| PC1903 | Unpaid annual fee |
St.27 status event code: N-4-6-H10-H13-oth-PC1903 Ip right cessation event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE Not in force date: 20091118 |
|
| P22-X000 | Classification modified |
St.27 status event code: A-4-4-P10-P22-nap-X000 |