-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing types such as Handle, Frame or TypePath
- Loading branch information
Vincent Rasquier
committed
Dec 14, 2017
1 parent
fdda36c
commit 4ae2d74
Showing
13 changed files
with
127 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package asm | ||
|
||
type Frame struct { | ||
owner *Label | ||
inputLocals []int | ||
inputStack []int | ||
outputLocals []int | ||
outputStack []int | ||
outputStackStart int16 | ||
outputStackTop int16 | ||
initializationCount int | ||
initializations []int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package asm | ||
|
||
type Handle struct { | ||
tag int | ||
owner string | ||
name string | ||
descriptor string | ||
isInterface bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package asm | ||
|
||
type TypePath struct { | ||
typePathContainer []byte | ||
typePathOffset int | ||
} | ||
|
||
func NewTypePathFromString(typePath string) *TypePath { | ||
if typePath == "" || len(typePath) == 0 { | ||
return nil | ||
} | ||
|
||
//typePathLength := len(typePath) | ||
/* | ||
ByteVector output = new ByteVector(typePathLength); | ||
output.putByte(0); | ||
for (int i = 0; i < typePathLength; ) { | ||
char c = typePath.charAt(i++); | ||
if (c == '[') { | ||
output.put11(ARRAY_ELEMENT, 0); | ||
} else if (c == '.') { | ||
output.put11(INNER_TYPE, 0); | ||
} else if (c == '*') { | ||
output.put11(WILDCARD_BOUND, 0); | ||
} else if (c >= '0' && c <= '9') { | ||
int typeArg = c - '0'; | ||
while (i < typePathLength && (c = typePath.charAt(i)) >= '0' && c <= '9') { | ||
typeArg = typeArg * 10 + c - '0'; | ||
i += 1; | ||
} | ||
if (i < typePathLength && typePath.charAt(i) == ';') { | ||
i += 1; | ||
} | ||
output.put11(TYPE_ARGUMENT, typeArg); | ||
} | ||
} | ||
output.data[0] = (byte) (output.length / 2); | ||
*/ | ||
return &TypePath{} | ||
} | ||
|
||
func (t TypePath) getLength() int { | ||
return int(t.typePathContainer[t.typePathOffset]) | ||
} | ||
|
||
func (t TypePath) getStep(index int) int { | ||
return int(t.typePathContainer[t.typePathOffset+2*index+1]) | ||
} | ||
|
||
func (t TypePath) getStepArgument(index int) int { | ||
return int(t.typePathContainer[t.typePathOffset+2*index+2]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1 @@ | ||
package asm | ||
|
||
// CLASS_TYPE_PARAMETER the sort of type references that target a type parameter of a generic class. See {@link #getSort}. | ||
const CLASS_TYPE_PARAMETER = 0x00 | ||
|
||
// METHOD_TYPE_PARAMETER the sort of type references that target a type parameter of a generic method. See {@link #getSort}. | ||
const METHOD_TYPE_PARAMETER = 0x01 | ||
|
||
// CLASS_EXTENDS The sort of type references that target the super class of a class or one of the interfaces it implements. See {@link #getSort}. | ||
const CLASS_EXTENDS = 0x10 | ||
|
||
// CLASS_TYPE_PARAMETER_BOUND the sort of type references that target a bound of a type parameter of a generic class. See {@link #getSort}. | ||
const CLASS_TYPE_PARAMETER_BOUND = 0x11 | ||
|
||
// METHOD_TYPE_PARAMETER_BOUND the sort of type references that target a bound of a type parameter of a generic method. See {@link #getSort}. | ||
const METHOD_TYPE_PARAMETER_BOUND = 0x12 | ||
|
||
// FIELD the sort of type references that target the type of a field. See {@link #getSort}. | ||
const FIELD = 0x13 | ||
|
||
// METHOD_RETURN the sort of type references that target the return type of a method. See {@link #getSort}. | ||
const METHOD_RETURN = 0x14 | ||
|
||
// METHOD_RECEIVER the sort of type references that target the receiver type of a method. See {@link #getSort}. | ||
const METHOD_RECEIVER = 0x15 | ||
|
||
/** | ||
* The sort of type references that target the type of a formal parameter of a method. See {@link | ||
* #getSort}. | ||
*/ | ||
const METHOD_FORMAL_PARAMETER = 0x16 | ||
|
||
/** | ||
* The sort of type references that target the type of an exception declared in the throws clause | ||
* of a method. See {@link #getSort}. | ||
*/ | ||
const THROWS = 0x17 | ||
|
||
/** | ||
* The sort of type references that target the type of a local variable in a method. See {@link | ||
* #getSort}. | ||
*/ | ||
const LOCAL_VARIABLE = 0x40 | ||
|
||
/** | ||
* The sort of type references that target the type of a resource variable in a method. See {@link | ||
* #getSort}. | ||
*/ | ||
const RESOURCE_VARIABLE = 0x41 | ||
|
||
/** | ||
* The sort of type references that target the type of the exception of a 'catch' clause in a | ||
* method. See {@link #getSort}. | ||
*/ | ||
const EXCEPTION_PARAMETER = 0x42 | ||
|
||
/** | ||
* The sort of type references that target the type declared in an 'instanceof' instruction. See | ||
* {@link #getSort}. | ||
*/ | ||
const INSTANCEOF = 0x43 | ||
|
||
/** | ||
* The sort of type references that target the type of the object created by a 'new' instruction. | ||
* See {@link #getSort}. | ||
*/ | ||
const NEW = 0x44 | ||
|
||
/** | ||
* The sort of type references that target the receiver type of a constructor reference. See | ||
* {@link #getSort}. | ||
*/ | ||
const CONSTRUCTOR_REFERENCE = 0x45 | ||
|
||
/** | ||
* The sort of type references that target the receiver type of a method reference. See {@link | ||
* #getSort}. | ||
*/ | ||
const METHOD_REFERENCE = 0x46 | ||
|
||
/** | ||
* The sort of type references that target the type declared in an explicit or implicit cast | ||
* instruction. See {@link #getSort}. | ||
*/ | ||
const CAST = 0x47 | ||
|
||
/** | ||
* The sort of type references that target a type parameter of a generic constructor in a | ||
* constructor call. See {@link #getSort}. | ||
*/ | ||
const CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48 | ||
|
||
/** | ||
* The sort of type references that target a type parameter of a generic method in a method call. | ||
* See {@link #getSort}. | ||
*/ | ||
const METHOD_INVOCATION_TYPE_ARGUMENT = 0x49 | ||
|
||
/** | ||
* The sort of type references that target a type parameter of a generic constructor in a | ||
* constructor reference. See {@link #getSort}. | ||
*/ | ||
const CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A | ||
|
||
/** | ||
* The sort of type references that target a type parameter of a generic method in a method | ||
* reference. See {@link #getSort}. | ||
*/ | ||
const METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package typereference | ||
|
||
const ( | ||
CLASS_TYPE_PARAMETER = 0x00 | ||
METHOD_TYPE_PARAMETER = 0x01 | ||
CLASS_EXTENDS = 0x10 | ||
CLASS_TYPE_PARAMETER_BOUND = 0x11 | ||
METHOD_TYPE_PARAMETER_BOUND = 0x12 | ||
FIELD = 0x13 | ||
METHOD_RETURN = 0x14 | ||
METHOD_RECEIVER = 0x15 | ||
METHOD_FORMAL_PARAMETER = 0x16 | ||
THROWS = 0x17 | ||
LOCAL_VARIABLE = 0x40 | ||
RESOURCE_VARIABLE = 0x41 | ||
EXCEPTION_PARAMETER = 0x42 | ||
INSTANCEOF = 0x43 | ||
NEW = 0x44 | ||
RUCTOR_REFERENCE = 0x45 | ||
METHOD_REFERENCE = 0x46 | ||
CAST = 0x47 | ||
CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48 | ||
METHOD_INVOCATION_TYPE_ARGUMENT = 0x49 | ||
CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A | ||
METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B | ||
) |
Oops, something went wrong.