File tree Expand file tree Collapse file tree 3 files changed +24
-37
lines changed Expand file tree Collapse file tree 3 files changed +24
-37
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ if (VERBOSE) {
94
94
load ( 'modules.js' ) ;
95
95
load ( 'parseTools.js' ) ;
96
96
load ( 'jsifier.js' ) ;
97
- load ( 'runtime.js' ) ;
98
97
if ( ! STRICT ) {
99
98
load ( 'parseTools_legacy.js' ) ;
100
99
}
Original file line number Diff line number Diff line change @@ -170,7 +170,8 @@ function needsQuoting(ident) {
170
170
return true ;
171
171
}
172
172
173
- const POINTER_SIZE = MEMORY64 ? 8 : 4 ;
173
+ global . POINTER_SIZE = MEMORY64 ? 8 : 4 ;
174
+ global . STACK_ALIGN = 16 ;
174
175
const POINTER_BITS = POINTER_SIZE * 8 ;
175
176
const POINTER_TYPE = 'u' + POINTER_BITS ;
176
177
const POINTER_JS_TYPE = MEMORY64 ? "'bigint'" : "'number'" ;
@@ -258,6 +259,28 @@ function indentify(text, indent) {
258
259
259
260
// Correction tools
260
261
262
+ function getNativeTypeSize ( type ) {
263
+ switch ( type ) {
264
+ case 'i1' : case 'i8' : case 'u8' : return 1 ;
265
+ case 'i16' : case 'u16' : return 2 ;
266
+ case 'i32' : case 'u32' : return 4 ;
267
+ case 'i64' : case 'u64' : return 8 ;
268
+ case 'float' : return 4 ;
269
+ case 'double' : return 8 ;
270
+ default : {
271
+ if ( type [ type . length - 1 ] === '*' ) {
272
+ return POINTER_SIZE ;
273
+ }
274
+ if ( type [ 0 ] === 'i' ) {
275
+ const bits = Number ( type . substr ( 1 ) ) ;
276
+ assert ( bits % 8 === 0 , 'getNativeTypeSize invalid bits ' + bits + ', type ' + type ) ;
277
+ return bits / 8 ;
278
+ }
279
+ return 0 ;
280
+ }
281
+ }
282
+ }
283
+
261
284
function getHeapOffset ( offset , type ) {
262
285
if ( type == 'i64' && ! WASM_BIGINT ) {
263
286
// We are foreced to use the 32-bit heap for 64-bit values when we don't
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments