-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use constants to determine classSize/cdvSize and fix wrong copy size …
…in initArrayClass
- Loading branch information
Showing
9 changed files
with
92 additions
and
46 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,28 @@ | ||
#include "constants.h" | ||
|
||
extern "C" { | ||
extern void Polyglot_jlang_runtime_Constants_load_class(); | ||
extern int Polyglot_jlang_runtime_Constants_classSize; | ||
extern int Polyglot_jlang_runtime_Constants_numOfRuntimeCdvArrayMethods; | ||
} | ||
|
||
static int __classSize = 0; | ||
static int __numOfRuntimeCdvArrayMethods = 0; | ||
|
||
inline void init() { | ||
if (__classSize == 0 && __numOfRuntimeCdvArrayMethods == 0) { | ||
Polyglot_jlang_runtime_Constants_load_class(); | ||
__classSize = Polyglot_jlang_runtime_Constants_classSize; | ||
__numOfRuntimeCdvArrayMethods = Polyglot_jlang_runtime_Constants_numOfRuntimeCdvArrayMethods; | ||
} | ||
} | ||
|
||
int getClassSize() { | ||
init(); | ||
return __classSize; | ||
} | ||
|
||
int getNumOfRuntimeArrayCdvMethods() { | ||
init(); | ||
return __numOfRuntimeCdvArrayMethods; | ||
} |
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,5 @@ | ||
#pragma once | ||
|
||
int getClassSize(); | ||
|
||
int getNumOfRuntimeArrayCdvMethods(); |
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,7 @@ | ||
package jlang.runtime; | ||
|
||
public class Constants { | ||
// TODO: auto-generate | ||
public static final int classSize = 168; // = v.obj.sizeOfObj(v.ts.Class()) | ||
public static final int numOfRuntimeCdvArrayMethods = 11; // = v.cdvMethods(v.ts.ArrayObject()).size() | ||
} |