From 7581ade802b2b9a4da715fbb1eab29b510f82263 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Wed, 28 Apr 2021 08:59:51 +0300 Subject: [PATCH 1/2] add toUTCString for Date --- std/assembly/date.ts | 32 ++ std/assembly/index.d.ts | 1 + tests/compiler/std/date.optimized.wat | 663 +++++++++++++++++++++----- tests/compiler/std/date.ts | 11 + tests/compiler/std/date.untouched.wat | 589 +++++++++++++++++++---- 5 files changed, 1088 insertions(+), 208 deletions(-) diff --git a/std/assembly/date.ts b/std/assembly/date.ts index 15ae17ae3d..3b69bcef6d 100644 --- a/std/assembly/date.ts +++ b/std/assembly/date.ts @@ -209,6 +209,38 @@ export class Date { ); } + toUTCString(): string { + const weeks: StaticArray = [ + "Sun, ", "Mon, ", "Tue, ", "Wed, ", "Thu, ", "Fri, ", "Sat, " + ]; + + const months: StaticArray = [ + " Jan ", " Feb ", " Mar ", " Apr ", " May ", " Jun ", + " Jul ", " Aug ", " Sep ", " Oct ", " Nov ", " Dec " + ]; + + var mo = this.month; + var da = this.day; + var yr = this.year; + var wd = dayOfWeek(yr, mo, da); + var year = abs(yr).toString().padStart(4, "0"); + if (yr < 0) year = "-" + year; + + return ( + unchecked(weeks[wd]) + + da.toString().padStart(2, "0") + + unchecked(months[mo - 1]) + + year + + " " + + this.getUTCHours().toString().padStart(2, "0") + + ":" + + this.getUTCMinutes().toString().padStart(2, "0") + + ":" + + this.getUTCSeconds().toString().padStart(2, "0") + + " GMT" + ); + } + toDateString(): string { // TODO: use u64 static data instead 4 chars // also use stream itoa variants. diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 1e98bf397b..65386bf6bf 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1758,6 +1758,7 @@ declare class Date { toString(): string; toISOString(): string; + toUTCString(): string; toDateString(): string; toTimeString(): string; } diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index 3137d7d368..bdbd29bf9b 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -25,7 +25,7 @@ (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 21484)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 22492)) (global $~started (mut i32) (i32.const 0)) (memory $0 1) (data (i32.const 1036) ",") @@ -139,44 +139,94 @@ (data (i32.const 3832) "\01\00\00\00\10\00\00\000\000\00:\000\000\00:\000\000") (data (i32.const 3868) ",") (data (i32.const 3880) "\01\00\00\00\10\00\00\002\003\00:\005\009\00:\005\009") - (data (i32.const 3916) ",") - (data (i32.const 3928) "\01\00\00\00\14\00\00\001\009\007\006\00-\000\002\00-\000\002") - (data (i32.const 3964) ",") - (data (i32.const 3976) "\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") - (data (i32.const 4012) ",") - (data (i32.const 4024) "\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 4060) "|") - (data (i32.const 4072) "\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") - (data (i32.const 4188) ",") - (data (i32.const 4200) "\01\00\00\00\10\00\00\001\009\007\006\00-\002\00-\002") - (data (i32.const 4236) ",") - (data (i32.const 4248) "\01\00\00\00\14\00\00\002\003\004\005\00-\001\001\00-\000\004") - (data (i32.const 4284) "<") - (data (i32.const 4296) "\01\00\00\00&\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006") - (data (i32.const 4348) "L") - (data (i32.const 4360) "\01\00\00\00.\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00.\004\005\006") - (data (i32.const 4428) "L") - (data (i32.const 4440) "\01\00\00\000\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00.\004\005\006\00Z") + (data (i32.const 3916) "\1c") + (data (i32.const 3928) "\01\00\00\00\n\00\00\00S\00u\00n\00,\00 ") + (data (i32.const 3948) "\1c") + (data (i32.const 3960) "\01\00\00\00\n\00\00\00M\00o\00n\00,\00 ") + (data (i32.const 3980) "\1c") + (data (i32.const 3992) "\01\00\00\00\n\00\00\00T\00u\00e\00,\00 ") + (data (i32.const 4012) "\1c") + (data (i32.const 4024) "\01\00\00\00\n\00\00\00W\00e\00d\00,\00 ") + (data (i32.const 4044) "\1c") + (data (i32.const 4056) "\01\00\00\00\n\00\00\00T\00h\00u\00,\00 ") + (data (i32.const 4076) "\1c") + (data (i32.const 4088) "\01\00\00\00\n\00\00\00F\00r\00i\00,\00 ") + (data (i32.const 4108) "\1c") + (data (i32.const 4120) "\01\00\00\00\n\00\00\00S\00a\00t\00,\00 ") + (data (i32.const 4140) ",") + (data (i32.const 4152) "\04\00\00\00\1c\00\00\00`\0f\00\00\80\0f\00\00\a0\0f\00\00\c0\0f\00\00\e0\0f\00\00\00\10\00\00 \10") + (data (i32.const 4188) "\1c") + (data (i32.const 4200) "\01\00\00\00\n\00\00\00 \00J\00a\00n\00 ") + (data (i32.const 4220) "\1c") + (data (i32.const 4232) "\01\00\00\00\n\00\00\00 \00F\00e\00b\00 ") + (data (i32.const 4252) "\1c") + (data (i32.const 4264) "\01\00\00\00\n\00\00\00 \00M\00a\00r\00 ") + (data (i32.const 4284) "\1c") + (data (i32.const 4296) "\01\00\00\00\n\00\00\00 \00A\00p\00r\00 ") + (data (i32.const 4316) "\1c") + (data (i32.const 4328) "\01\00\00\00\n\00\00\00 \00M\00a\00y\00 ") + (data (i32.const 4348) "\1c") + (data (i32.const 4360) "\01\00\00\00\n\00\00\00 \00J\00u\00n\00 ") + (data (i32.const 4380) "\1c") + (data (i32.const 4392) "\01\00\00\00\n\00\00\00 \00J\00u\00l\00 ") + (data (i32.const 4412) "\1c") + (data (i32.const 4424) "\01\00\00\00\n\00\00\00 \00A\00u\00g\00 ") + (data (i32.const 4444) "\1c") + (data (i32.const 4456) "\01\00\00\00\n\00\00\00 \00S\00e\00p\00 ") + (data (i32.const 4476) "\1c") + (data (i32.const 4488) "\01\00\00\00\n\00\00\00 \00O\00c\00t\00 ") (data (i32.const 4508) "\1c") - (data (i32.const 4520) "\01\00\00\00\08\00\00\000\000\000\000") + (data (i32.const 4520) "\01\00\00\00\n\00\00\00 \00N\00o\00v\00 ") (data (i32.const 4540) "\1c") - (data (i32.const 4552) "\01\00\00\00\08\00\00\000\000\000\001") - (data (i32.const 4572) "\1c") - (data (i32.const 4584) "\01\00\00\00\08\00\00\001\009\007\006") - (data (i32.const 4604) ",") - (data (i32.const 4616) "\01\00\00\00\0e\00\00\001\009\007\006\00-\000\002") - (data (i32.const 4652) "<") - (data (i32.const 4664) "\01\00\00\00 \00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004") - (data (i32.const 4716) "L") - (data (i32.const 4728) "\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\000\00Z") - (data (i32.const 4796) "L") - (data (i32.const 4808) "\01\00\00\006\00\00\00+\002\007\005\007\006\000\00-\000\009\00-\001\003\00T\000\000\00:\000\000\00:\000\000\00.\000\000\000\00Z") - (data (i32.const 4876) "L") - (data (i32.const 4888) "\01\00\00\006\00\00\00+\002\007\005\007\006\000\00-\000\009\00-\001\002\00T\002\003\00:\005\009\00:\005\009\00.\009\009\009\00Z") - (data (i32.const 4956) "L") - (data (i32.const 4968) "\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\001\00Z") - (data (i32.const 5040) "\07\00\00\00 \00\00\00\00\00\00\00 ") - (data (i32.const 5068) " \00\00\00\00\00\00\00\04A\00\00\00\00\00\00\02A\00\00\00\00\00\00\02\t") + (data (i32.const 4552) "\01\00\00\00\n\00\00\00 \00D\00e\00c\00 ") + (data (i32.const 4572) "L") + (data (i32.const 4584) "\04\00\00\000\00\00\00p\10\00\00\90\10\00\00\b0\10\00\00\d0\10\00\00\f0\10\00\00\10\11\00\000\11\00\00P\11\00\00p\11\00\00\90\11\00\00\b0\11\00\00\d0\11") + (data (i32.const 4652) "\1c") + (data (i32.const 4664) "\01\00\00\00\08\00\00\00 \00G\00M\00T") + (data (i32.const 4684) "L") + (data (i32.const 4696) "\01\00\00\00:\00\00\00W\00e\00d\00,\00 \000\001\00 \00J\00a\00n\00 \000\000\002\000\00 \000\000\00:\000\000\00:\000\000\00 \00G\00M\00T") + (data (i32.const 4764) "L") + (data (i32.const 4776) "\01\00\00\00:\00\00\00M\00o\00n\00,\00 \000\003\00 \00F\00e\00b\00 \002\000\002\000\00 \001\004\00:\005\003\00:\003\003\00 \00G\00M\00T") + (data (i32.const 4844) "L") + (data (i32.const 4856) "\01\00\00\00<\00\00\00T\00h\00u\00,\00 \000\001\00 \00J\00u\00l\00 \00-\000\000\000\001\00 \000\000\00:\000\000\00:\000\000\00 \00G\00M\00T") + (data (i32.const 4924) ",") + (data (i32.const 4936) "\01\00\00\00\14\00\00\001\009\007\006\00-\000\002\00-\000\002") + (data (i32.const 4972) ",") + (data (i32.const 4984) "\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 5020) ",") + (data (i32.const 5032) "\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 5068) "|") + (data (i32.const 5080) "\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") + (data (i32.const 5196) ",") + (data (i32.const 5208) "\01\00\00\00\10\00\00\001\009\007\006\00-\002\00-\002") + (data (i32.const 5244) ",") + (data (i32.const 5256) "\01\00\00\00\14\00\00\002\003\004\005\00-\001\001\00-\000\004") + (data (i32.const 5292) "<") + (data (i32.const 5304) "\01\00\00\00&\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006") + (data (i32.const 5356) "L") + (data (i32.const 5368) "\01\00\00\00.\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00.\004\005\006") + (data (i32.const 5436) "L") + (data (i32.const 5448) "\01\00\00\000\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00.\004\005\006\00Z") + (data (i32.const 5516) "\1c") + (data (i32.const 5528) "\01\00\00\00\08\00\00\000\000\000\000") + (data (i32.const 5548) "\1c") + (data (i32.const 5560) "\01\00\00\00\08\00\00\000\000\000\001") + (data (i32.const 5580) "\1c") + (data (i32.const 5592) "\01\00\00\00\08\00\00\001\009\007\006") + (data (i32.const 5612) ",") + (data (i32.const 5624) "\01\00\00\00\0e\00\00\001\009\007\006\00-\000\002") + (data (i32.const 5660) "<") + (data (i32.const 5672) "\01\00\00\00 \00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004") + (data (i32.const 5724) "L") + (data (i32.const 5736) "\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\000\00Z") + (data (i32.const 5804) "L") + (data (i32.const 5816) "\01\00\00\006\00\00\00+\002\007\005\007\006\000\00-\000\009\00-\001\003\00T\000\000\00:\000\000\00:\000\000\00.\000\000\000\00Z") + (data (i32.const 5884) "L") + (data (i32.const 5896) "\01\00\00\006\00\00\00+\002\007\005\007\006\000\00-\000\009\00-\001\002\00T\002\003\00:\005\009\00:\005\009\00.\009\009\009\00Z") + (data (i32.const 5964) "L") + (data (i32.const 5976) "\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\001\00Z") + (data (i32.const 6048) "\07\00\00\00 \00\00\00\00\00\00\00 ") + (data (i32.const 6076) " \00\00\00\00\00\00\00\04A\00\00\00\00\00\00\02A\00\00\00\00\00\00\02\t") (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/date/daysSinceEpoch (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -378,9 +428,9 @@ (local $1 i32) i32.const 1392 call $~lib/rt/itcms/__visit - i32.const 3984 + i32.const 4992 call $~lib/rt/itcms/__visit - i32.const 4080 + i32.const 5088 call $~lib/rt/itcms/__visit i32.const 1200 call $~lib/rt/itcms/__visit @@ -498,7 +548,7 @@ if i32.const 0 local.get $0 - i32.const 21484 + i32.const 22492 i32.lt_u local.get $0 i32.load offset=8 @@ -544,7 +594,7 @@ i32.const 1 else local.get $1 - i32.const 5040 + i32.const 6048 i32.load i32.gt_u if @@ -558,7 +608,7 @@ local.get $1 i32.const 3 i32.shl - i32.const 5044 + i32.const 6052 i32.add i32.load i32.const 32 @@ -1132,10 +1182,10 @@ if unreachable end - i32.const 21488 + i32.const 22496 i32.const 0 i32.store - i32.const 23056 + i32.const 24064 i32.const 0 i32.store loop $for-loop|0 @@ -1146,7 +1196,7 @@ local.get $1 i32.const 2 i32.shl - i32.const 21488 + i32.const 22496 i32.add i32.const 0 i32.store offset=4 @@ -1164,7 +1214,7 @@ i32.add i32.const 2 i32.shl - i32.const 21488 + i32.const 22496 i32.add i32.const 0 i32.store offset=96 @@ -1182,13 +1232,13 @@ br $for-loop|0 end end - i32.const 21488 - i32.const 23060 + i32.const 22496 + i32.const 24068 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 21488 + i32.const 22496 global.set $~lib/rt/tlsf/ROOT ) (func $~lib/rt/itcms/step (result i32) @@ -1267,7 +1317,7 @@ local.set $0 loop $while-continue|0 local.get $0 - i32.const 21484 + i32.const 22492 i32.lt_u if local.get $0 @@ -1357,7 +1407,7 @@ unreachable end local.get $0 - i32.const 21484 + i32.const 22492 i32.lt_u if local.get $0 @@ -1380,7 +1430,7 @@ i32.const 4 i32.add local.tee $1 - i32.const 21484 + i32.const 22492 i32.ge_u if global.get $~lib/rt/tlsf/ROOT @@ -3031,8 +3081,8 @@ i32.const 268435455 i32.gt_u if - i32.const 3984 - i32.const 4032 + i32.const 4992 + i32.const 5040 i32.const 14 i32.const 48 call $~lib/builtins/abort @@ -3505,11 +3555,11 @@ ) (func $~stack_check global.get $~lib/memory/__stack_pointer - i32.const 5100 + i32.const 6108 i32.lt_s if - i32.const 21504 - i32.const 21552 + i32.const 22512 + i32.const 22560 i32.const 1 i32.const 1 call $~lib/builtins/abort @@ -4118,6 +4168,287 @@ i32.add global.set $~lib/memory/__stack_pointer ) + (func $~lib/date/Date#toUTCString (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + global.get $~lib/memory/__stack_pointer + i32.const 96 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=8 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=16 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=24 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=32 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=40 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=48 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=56 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=64 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=72 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=80 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=88 + global.get $~lib/memory/__stack_pointer + i32.const 28 + i32.const 4 + i32.const 4160 + call $~lib/rt/__newBuffer + local.tee $3 + i32.store + global.get $~lib/memory/__stack_pointer + i32.const 48 + i32.const 4 + i32.const 4592 + call $~lib/rt/__newBuffer + local.tee $4 + i32.store offset=4 + local.get $0 + i32.load + local.tee $1 + local.get $0 + i32.load offset=4 + local.tee $5 + local.get $0 + i32.load offset=8 + local.tee $6 + call $~lib/date/dayOfWeek + local.set $7 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.const 31 + i32.shr_s + local.tee $2 + local.get $1 + local.get $2 + i32.add + i32.xor + call $~lib/number/I32#toString + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=8 + global.get $~lib/memory/__stack_pointer + i32.const 1872 + i32.store offset=12 + local.get $2 + i32.const 4 + call $~lib/string/String#padStart + local.tee $2 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.lt_s + if + global.get $~lib/memory/__stack_pointer + i32.const 1616 + i32.store offset=8 + global.get $~lib/memory/__stack_pointer + i32.const 1616 + local.get $2 + call $~lib/string/String.__concat + local.tee $2 + i32.store offset=16 + end + global.get $~lib/memory/__stack_pointer + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $3 + i32.store offset=80 + local.get $6 + call $~lib/number/I32#toString + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=88 + global.get $~lib/memory/__stack_pointer + i32.const 1872 + i32.store offset=92 + local.get $1 + i32.const 2 + call $~lib/string/String#padStart + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=84 + local.get $3 + local.get $1 + call $~lib/string/String.__concat + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=72 + global.get $~lib/memory/__stack_pointer + local.get $4 + local.get $5 + i32.const 1 + i32.sub + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $3 + i32.store offset=76 + local.get $1 + local.get $3 + call $~lib/string/String.__concat + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=68 + local.get $1 + local.get $2 + call $~lib/string/String.__concat + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=60 + global.get $~lib/memory/__stack_pointer + i32.const 3616 + i32.store offset=64 + local.get $1 + i32.const 3616 + call $~lib/string/String.__concat + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=52 + local.get $0 + call $~lib/date/Date#getUTCHours + call $~lib/number/I32#toString + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=60 + global.get $~lib/memory/__stack_pointer + i32.const 1872 + i32.store offset=68 + local.get $2 + i32.const 2 + call $~lib/string/String#padStart + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=56 + local.get $1 + local.get $2 + call $~lib/string/String.__concat + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=44 + global.get $~lib/memory/__stack_pointer + i32.const 2064 + i32.store offset=48 + local.get $1 + i32.const 2064 + call $~lib/string/String.__concat + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=36 + local.get $0 + call $~lib/date/Date#getUTCMinutes + call $~lib/number/I32#toString + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=44 + global.get $~lib/memory/__stack_pointer + i32.const 1872 + i32.store offset=52 + local.get $2 + i32.const 2 + call $~lib/string/String#padStart + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=40 + local.get $1 + local.get $2 + call $~lib/string/String.__concat + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=28 + global.get $~lib/memory/__stack_pointer + i32.const 2064 + i32.store offset=32 + local.get $1 + i32.const 2064 + call $~lib/string/String.__concat + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store offset=12 + local.get $0 + call $~lib/date/Date#getUTCSeconds + call $~lib/number/I32#toString + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=28 + global.get $~lib/memory/__stack_pointer + i32.const 1872 + i32.store offset=36 + local.get $0 + i32.const 2 + call $~lib/string/String#padStart + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=24 + local.get $1 + local.get $0 + call $~lib/string/String.__concat + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=8 + global.get $~lib/memory/__stack_pointer + i32.const 4672 + i32.store offset=20 + local.get $0 + i32.const 4672 + call $~lib/string/String.__concat + global.get $~lib/memory/__stack_pointer + i32.const 96 + i32.add + global.set $~lib/memory/__stack_pointer + ) (func $~lib/string/String#split (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -4802,7 +5133,7 @@ memory.size i32.const 16 i32.shl - i32.const 21484 + i32.const 22492 i32.sub i32.const 1 i32.shr_u @@ -6341,10 +6672,88 @@ unreachable end global.get $~lib/memory/__stack_pointer - i32.const 3936 + i64.const -61536067200000 + call $~lib/date/Date#constructor + local.tee $0 + i32.store + local.get $0 + call $~lib/date/Date#toUTCString + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 3936 + i32.const 4704 + i32.store offset=8 + local.get $0 + i32.const 4704 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1152 + i32.const 273 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i64.const 1580741613467 + call $~lib/date/Date#constructor + local.tee $0 + i32.store + local.get $0 + call $~lib/date/Date#toUTCString + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 + global.get $~lib/memory/__stack_pointer + i32.const 4784 + i32.store offset=8 + local.get $0 + i32.const 4784 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1152 + i32.const 275 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i64.const -62183116800000 + call $~lib/date/Date#constructor + local.tee $0 + i32.store + local.get $0 + call $~lib/date/Date#toUTCString + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 + global.get $~lib/memory/__stack_pointer + i32.const 4864 + i32.store offset=8 + local.get $0 + i32.const 4864 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1152 + i32.const 278 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 4944 + i32.store offset=4 + global.get $~lib/memory/__stack_pointer + i32.const 4944 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6355,16 +6764,16 @@ if i32.const 0 i32.const 1152 - i32.const 274 + i32.const 285 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4208 + i32.const 5216 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4208 + i32.const 5216 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6375,16 +6784,16 @@ if i32.const 0 i32.const 1152 - i32.const 276 + i32.const 287 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4256 + i32.const 5264 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4256 + i32.const 5264 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6395,16 +6804,16 @@ if i32.const 0 i32.const 1152 - i32.const 278 + i32.const 289 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4304 + i32.const 5312 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4304 + i32.const 5312 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6415,16 +6824,16 @@ if i32.const 0 i32.const 1152 - i32.const 282 + i32.const 293 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4368 + i32.const 5376 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4368 + i32.const 5376 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6435,16 +6844,16 @@ if i32.const 0 i32.const 1152 - i32.const 286 + i32.const 297 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4448 + i32.const 5456 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4448 + i32.const 5456 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6455,16 +6864,16 @@ if i32.const 0 i32.const 1152 - i32.const 290 + i32.const 301 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4528 + i32.const 5536 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4528 + i32.const 5536 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6475,16 +6884,16 @@ if i32.const 0 i32.const 1152 - i32.const 293 + i32.const 304 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4560 + i32.const 5568 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4560 + i32.const 5568 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6495,16 +6904,16 @@ if i32.const 0 i32.const 1152 - i32.const 296 + i32.const 307 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4592 + i32.const 5600 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4592 + i32.const 5600 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6515,16 +6924,16 @@ if i32.const 0 i32.const 1152 - i32.const 299 + i32.const 310 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4624 + i32.const 5632 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4624 + i32.const 5632 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6535,16 +6944,16 @@ if i32.const 0 i32.const 1152 - i32.const 302 + i32.const 313 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 3936 + i32.const 4944 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 3936 + i32.const 4944 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6555,16 +6964,16 @@ if i32.const 0 i32.const 1152 - i32.const 305 + i32.const 316 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4672 + i32.const 5680 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4672 + i32.const 5680 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6575,16 +6984,16 @@ if i32.const 0 i32.const 1152 - i32.const 308 + i32.const 319 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4304 + i32.const 5312 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4304 + i32.const 5312 call $~lib/date/Date.fromString local.tee $0 i32.store @@ -6595,7 +7004,7 @@ if i32.const 0 i32.const 1152 - i32.const 311 + i32.const 322 i32.const 3 call $~lib/builtins/abort unreachable @@ -6617,7 +7026,7 @@ if i32.const 0 i32.const 1152 - i32.const 329 + i32.const 340 i32.const 3 call $~lib/builtins/abort unreachable @@ -6629,7 +7038,7 @@ if i32.const 0 i32.const 1152 - i32.const 330 + i32.const 341 i32.const 3 call $~lib/builtins/abort unreachable @@ -6641,7 +7050,7 @@ if i32.const 0 i32.const 1152 - i32.const 332 + i32.const 343 i32.const 3 call $~lib/builtins/abort unreachable @@ -6653,7 +7062,7 @@ if i32.const 0 i32.const 1152 - i32.const 333 + i32.const 344 i32.const 3 call $~lib/builtins/abort unreachable @@ -6665,7 +7074,7 @@ if i32.const 0 i32.const 1152 - i32.const 335 + i32.const 346 i32.const 3 call $~lib/builtins/abort unreachable @@ -6677,7 +7086,7 @@ if i32.const 0 i32.const 1152 - i32.const 336 + i32.const 347 i32.const 3 call $~lib/builtins/abort unreachable @@ -6689,7 +7098,7 @@ if i32.const 0 i32.const 1152 - i32.const 338 + i32.const 349 i32.const 3 call $~lib/builtins/abort unreachable @@ -6701,7 +7110,7 @@ if i32.const 0 i32.const 1152 - i32.const 339 + i32.const 350 i32.const 3 call $~lib/builtins/abort unreachable @@ -6713,16 +7122,16 @@ local.get $0 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4736 + i32.const 5744 i32.store offset=8 local.get $0 - i32.const 4736 + i32.const 5744 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 1152 - i32.const 341 + i32.const 352 i32.const 3 call $~lib/builtins/abort unreachable @@ -6734,16 +7143,16 @@ local.get $0 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4816 + i32.const 5824 i32.store offset=8 local.get $0 - i32.const 4816 + i32.const 5824 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 1152 - i32.const 342 + i32.const 353 i32.const 3 call $~lib/builtins/abort unreachable @@ -6765,7 +7174,7 @@ if i32.const 0 i32.const 1152 - i32.const 347 + i32.const 358 i32.const 3 call $~lib/builtins/abort unreachable @@ -6777,7 +7186,7 @@ if i32.const 0 i32.const 1152 - i32.const 348 + i32.const 359 i32.const 3 call $~lib/builtins/abort unreachable @@ -6789,7 +7198,7 @@ if i32.const 0 i32.const 1152 - i32.const 349 + i32.const 360 i32.const 3 call $~lib/builtins/abort unreachable @@ -6799,7 +7208,7 @@ if i32.const 0 i32.const 1152 - i32.const 350 + i32.const 361 i32.const 3 call $~lib/builtins/abort unreachable @@ -6809,7 +7218,7 @@ if i32.const 0 i32.const 1152 - i32.const 351 + i32.const 362 i32.const 3 call $~lib/builtins/abort unreachable @@ -6819,7 +7228,7 @@ if i32.const 0 i32.const 1152 - i32.const 352 + i32.const 363 i32.const 3 call $~lib/builtins/abort unreachable @@ -6831,7 +7240,7 @@ if i32.const 0 i32.const 1152 - i32.const 353 + i32.const 364 i32.const 3 call $~lib/builtins/abort unreachable @@ -6843,16 +7252,16 @@ local.get $2 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4896 + i32.const 5904 i32.store offset=8 local.get $2 - i32.const 4896 + i32.const 5904 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 1152 - i32.const 355 + i32.const 366 i32.const 3 call $~lib/builtins/abort unreachable @@ -6864,16 +7273,16 @@ local.get $0 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 4976 + i32.const 5984 i32.store offset=8 local.get $0 - i32.const 4976 + i32.const 5984 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 1152 - i32.const 356 + i32.const 367 i32.const 3 call $~lib/builtins/abort unreachable @@ -7234,7 +7643,7 @@ i32.ge_u if i32.const 1392 - i32.const 4032 + i32.const 5040 i32.const 92 i32.const 42 call $~lib/builtins/abort @@ -7253,8 +7662,8 @@ local.get $0 i32.eqz if - i32.const 4080 - i32.const 4032 + i32.const 5088 + i32.const 5040 i32.const 96 i32.const 40 call $~lib/builtins/abort diff --git a/tests/compiler/std/date.ts b/tests/compiler/std/date.ts index cd115a8924..87cbab1df5 100644 --- a/tests/compiler/std/date.ts +++ b/tests/compiler/std/date.ts @@ -267,6 +267,17 @@ assert(date.toTimeString() == "23:59:59"); // use UTC time instead local } +// Date#toUTCString /////////////////////////////////////////////////////////////////////////////// +{ + let date = new Date(-61536067200000); + assert(date.toUTCString() == "Wed, 01 Jan 0020 00:00:00 GMT"); + date = new Date(1580741613467); + assert(date.toUTCString() == "Mon, 03 Feb 2020 14:53:33 GMT"); + // negative year + date = new Date(-62183116800000); // '-000001-07-01T00:00Z' + assert(date.toUTCString() == "Thu, 01 Jul -0001 00:00:00 GMT"); +} + // Date#fromString ///////////////////////////////////////////////////////////////////////////////// { // supports year / month / day diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index 236217fcea..7f69bce24d 100644 --- a/tests/compiler/std/date.untouched.wat +++ b/tests/compiler/std/date.untouched.wat @@ -35,10 +35,10 @@ (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) - (global $~lib/rt/__rtti_base i32 (i32.const 5472)) - (global $~lib/memory/__data_end i32 (i32.const 5532)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 21916)) - (global $~lib/memory/__heap_base i32 (i32.const 21916)) + (global $~lib/rt/__rtti_base i32 (i32.const 6480)) + (global $~lib/memory/__data_end i32 (i32.const 6540)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 22924)) + (global $~lib/memory/__heap_base i32 (i32.const 22924)) (global $~started (mut i32) (i32.const 0)) (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\18\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00D\00a\00t\00e\00\00\00\00\00") @@ -102,25 +102,50 @@ (data (i32.const 4188) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00T\00h\00u\00 \00J\00u\00l\00 \000\001\00 \00-\000\000\000\001\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 4252) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\000\000\00:\000\000\00:\000\000\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 4300) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\002\003\00:\005\009\00:\005\009\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4348) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\001\009\007\006\00-\000\002\00-\000\002\00\00\00\00\00\00\00\00\00") - (data (i32.const 4396) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") - (data (i32.const 4444) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") - (data (i32.const 4492) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4620) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\001\009\007\006\00-\002\00-\002\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4668) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\002\003\004\005\00-\001\001\00-\000\004\00\00\00\00\00\00\00\00\00") - (data (i32.const 4716) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00\00\00\00\00\00\00") - (data (i32.const 4780) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00.\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00.\004\005\006\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4860) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\000\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00.\004\005\006\00Z\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4940) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\000\000\000\000\00\00\00\00\00") - (data (i32.const 4972) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\000\000\000\001\00\00\00\00\00") - (data (i32.const 5004) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\001\009\007\006\00\00\00\00\00") - (data (i32.const 5036) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\001\009\007\006\00-\000\002\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 5084) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 5148) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\000\00Z\00\00\00\00\00\00\00") - (data (i32.const 5228) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00+\002\007\005\007\006\000\00-\000\009\00-\001\003\00T\000\000\00:\000\000\00:\000\000\00.\000\000\000\00Z\00\00\00\00\00\00\00") - (data (i32.const 5308) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00+\002\007\005\007\006\000\00-\000\009\00-\001\002\00T\002\003\00:\005\009\00:\005\009\00.\009\009\009\00Z\00\00\00\00\00\00\00") - (data (i32.const 5388) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\001\00Z\00\00\00\00\00\00\00") - (data (i32.const 5472) "\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\04A\00\00\00\00\00\00\02A\00\00\00\00\00\00\02\t\00\00\00\00\00\00") + (data (i32.const 4348) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00S\00u\00n\00,\00 \00\00\00") + (data (i32.const 4380) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00M\00o\00n\00,\00 \00\00\00") + (data (i32.const 4412) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00T\00u\00e\00,\00 \00\00\00") + (data (i32.const 4444) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00W\00e\00d\00,\00 \00\00\00") + (data (i32.const 4476) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00T\00h\00u\00,\00 \00\00\00") + (data (i32.const 4508) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00F\00r\00i\00,\00 \00\00\00") + (data (i32.const 4540) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00S\00a\00t\00,\00 \00\00\00") + (data (i32.const 4572) ",\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\1c\00\00\00\10\11\00\000\11\00\00P\11\00\00p\11\00\00\90\11\00\00\b0\11\00\00\d0\11\00\00") + (data (i32.const 4620) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00J\00a\00n\00 \00\00\00") + (data (i32.const 4652) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00F\00e\00b\00 \00\00\00") + (data (i32.const 4684) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00M\00a\00r\00 \00\00\00") + (data (i32.const 4716) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00A\00p\00r\00 \00\00\00") + (data (i32.const 4748) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00M\00a\00y\00 \00\00\00") + (data (i32.const 4780) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00J\00u\00n\00 \00\00\00") + (data (i32.const 4812) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00J\00u\00l\00 \00\00\00") + (data (i32.const 4844) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00A\00u\00g\00 \00\00\00") + (data (i32.const 4876) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00S\00e\00p\00 \00\00\00") + (data (i32.const 4908) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00O\00c\00t\00 \00\00\00") + (data (i32.const 4940) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00N\00o\00v\00 \00\00\00") + (data (i32.const 4972) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00 \00D\00e\00c\00 \00\00\00") + (data (i32.const 5004) "L\00\00\00\00\00\00\00\00\00\00\00\04\00\00\000\00\00\00 \12\00\00@\12\00\00`\12\00\00\80\12\00\00\a0\12\00\00\c0\12\00\00\e0\12\00\00\00\13\00\00 \13\00\00@\13\00\00`\13\00\00\80\13\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 5084) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00 \00G\00M\00T\00\00\00\00\00") + (data (i32.const 5116) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00:\00\00\00W\00e\00d\00,\00 \000\001\00 \00J\00a\00n\00 \000\000\002\000\00 \000\000\00:\000\000\00:\000\000\00 \00G\00M\00T\00\00\00") + (data (i32.const 5196) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00:\00\00\00M\00o\00n\00,\00 \000\003\00 \00F\00e\00b\00 \002\000\002\000\00 \001\004\00:\005\003\00:\003\003\00 \00G\00M\00T\00\00\00") + (data (i32.const 5276) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00<\00\00\00T\00h\00u\00,\00 \000\001\00 \00J\00u\00l\00 \00-\000\000\000\001\00 \000\000\00:\000\000\00:\000\000\00 \00G\00M\00T\00") + (data (i32.const 5356) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\001\009\007\006\00-\000\002\00-\000\002\00\00\00\00\00\00\00\00\00") + (data (i32.const 5404) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 5452) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") + (data (i32.const 5500) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 5628) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\001\009\007\006\00-\002\00-\002\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 5676) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\002\003\004\005\00-\001\001\00-\000\004\00\00\00\00\00\00\00\00\00") + (data (i32.const 5724) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00\00\00\00\00\00\00") + (data (i32.const 5788) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00.\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00.\004\005\006\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 5868) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\000\00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00:\005\006\00.\004\005\006\00Z\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 5948) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\000\000\000\000\00\00\00\00\00") + (data (i32.const 5980) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\000\000\000\001\00\00\00\00\00") + (data (i32.const 6012) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\001\009\007\006\00\00\00\00\00") + (data (i32.const 6044) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\001\009\007\006\00-\000\002\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 6092) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\001\009\007\006\00-\000\002\00-\000\002\00T\001\002\00:\003\004\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 6156) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\000\00Z\00\00\00\00\00\00\00") + (data (i32.const 6236) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00+\002\007\005\007\006\000\00-\000\009\00-\001\003\00T\000\000\00:\000\000\00:\000\000\00.\000\000\000\00Z\00\00\00\00\00\00\00") + (data (i32.const 6316) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00+\002\007\005\007\006\000\00-\000\009\00-\001\002\00T\002\003\00:\005\009\00:\005\009\00.\009\009\009\00Z\00\00\00\00\00\00\00") + (data (i32.const 6396) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\001\00Z\00\00\00\00\00\00\00") + (data (i32.const 6480) "\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\04A\00\00\00\00\00\00\02A\00\00\00\00\00\00\02\t\00\00\00\00\00\00") (table $0 1 funcref) (export "memory" (memory $0)) (export "_start" (func $~start)) @@ -5279,8 +5304,8 @@ i32.shr_u i32.gt_u if - i32.const 4416 - i32.const 4464 + i32.const 5424 + i32.const 5472 i32.const 14 i32.const 48 call $~lib/builtins/abort @@ -5763,10 +5788,10 @@ i32.const 368 local.get $0 call $~lib/rt/itcms/__visit - i32.const 4416 + i32.const 5424 local.get $0 call $~lib/rt/itcms/__visit - i32.const 4512 + i32.const 5520 local.get $0 call $~lib/rt/itcms/__visit i32.const 176 @@ -5958,8 +5983,8 @@ global.get $~lib/memory/__data_end i32.lt_s if - i32.const 21936 - i32.const 21984 + i32.const 22944 + i32.const 22992 i32.const 1 i32.const 1 call $~lib/builtins/abort @@ -6659,6 +6684,321 @@ global.set $~lib/memory/__stack_pointer local.get $1 ) + (func $~lib/date/Date#toUTCString (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + global.get $~lib/memory/__stack_pointer + i32.const 96 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=8 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=16 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=24 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=32 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=40 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=48 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=56 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=64 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=72 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=80 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=88 + global.get $~lib/memory/__stack_pointer + i32.const 28 + i32.const 4 + i32.const 4592 + call $~lib/rt/__newBuffer + local.tee $1 + i32.store + global.get $~lib/memory/__stack_pointer + i32.const 48 + i32.const 4 + i32.const 5024 + call $~lib/rt/__newBuffer + local.tee $2 + i32.store offset=4 + local.get $0 + i32.load offset=4 + local.set $3 + local.get $0 + i32.load offset=8 + local.set $4 + local.get $0 + i32.load + local.set $5 + local.get $5 + local.get $3 + local.get $4 + call $~lib/date/dayOfWeek + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $5 + local.tee $7 + i32.const 31 + i32.shr_s + local.tee $8 + local.get $7 + i32.add + local.get $8 + i32.xor + i32.const 10 + call $~lib/number/I32#toString + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=8 + local.get $10 + i32.const 4 + i32.const 848 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=12 + local.get $10 + call $~lib/string/String#padStart + local.tee $9 + i32.store offset=16 + local.get $5 + i32.const 0 + i32.lt_s + if + global.get $~lib/memory/__stack_pointer + i32.const 592 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=8 + local.get $10 + local.get $9 + call $~lib/string/String.__concat + local.tee $9 + i32.store offset=16 + end + local.get $1 + local.get $6 + call $~lib/staticarray/StaticArray<~lib/string/String>#__uget + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=80 + local.get $10 + local.get $4 + i32.const 10 + call $~lib/number/I32#toString + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=88 + local.get $10 + i32.const 2 + i32.const 848 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=92 + local.get $10 + call $~lib/string/String#padStart + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=84 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=72 + local.get $10 + local.get $2 + local.get $3 + i32.const 1 + i32.sub + call $~lib/staticarray/StaticArray<~lib/string/String>#__uget + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=76 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=68 + local.get $10 + local.get $9 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=60 + local.get $10 + i32.const 4048 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=64 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=52 + local.get $10 + local.get $0 + call $~lib/date/Date#getUTCHours + i32.const 10 + call $~lib/number/I32#toString + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=60 + local.get $10 + i32.const 2 + i32.const 848 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=68 + local.get $10 + call $~lib/string/String#padStart + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=56 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=44 + local.get $10 + i32.const 2496 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=48 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=36 + local.get $10 + local.get $0 + call $~lib/date/Date#getUTCMinutes + i32.const 10 + call $~lib/number/I32#toString + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=44 + local.get $10 + i32.const 2 + i32.const 848 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=52 + local.get $10 + call $~lib/string/String#padStart + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=40 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=28 + local.get $10 + i32.const 2496 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=32 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=12 + local.get $10 + local.get $0 + call $~lib/date/Date#getUTCSeconds + i32.const 10 + call $~lib/number/I32#toString + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=28 + local.get $10 + i32.const 2 + i32.const 848 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=36 + local.get $10 + call $~lib/string/String#padStart + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=24 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=8 + local.get $10 + i32.const 5104 + local.set $10 + global.get $~lib/memory/__stack_pointer + local.get $10 + i32.store offset=20 + local.get $10 + call $~lib/string/String.__concat + local.set $10 + global.get $~lib/memory/__stack_pointer + i32.const 96 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $10 + ) (func $~lib/string/String#split (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -9478,7 +9818,94 @@ unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4368 + i32.const 0 + i64.const -61536067200000 + call $~lib/date/Date#constructor + local.tee $1 + i32.store + local.get $1 + call $~lib/date/Date#toUTCString + local.set $8 + global.get $~lib/memory/__stack_pointer + local.get $8 + i32.store offset=4 + local.get $8 + i32.const 5136 + local.set $8 + global.get $~lib/memory/__stack_pointer + local.get $8 + i32.store offset=8 + local.get $8 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 273 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 0 + i64.const 1580741613467 + call $~lib/date/Date#constructor + local.tee $1 + i32.store + local.get $1 + call $~lib/date/Date#toUTCString + local.set $8 + global.get $~lib/memory/__stack_pointer + local.get $8 + i32.store offset=4 + local.get $8 + i32.const 5216 + local.set $8 + global.get $~lib/memory/__stack_pointer + local.get $8 + i32.store offset=8 + local.get $8 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 275 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 0 + i64.const -62183116800000 + call $~lib/date/Date#constructor + local.tee $1 + i32.store + local.get $1 + call $~lib/date/Date#toUTCString + local.set $8 + global.get $~lib/memory/__stack_pointer + local.get $8 + i32.store offset=4 + local.get $8 + i32.const 5296 + local.set $8 + global.get $~lib/memory/__stack_pointer + local.get $8 + i32.store offset=8 + local.get $8 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 5376 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9495,13 +9922,13 @@ if i32.const 0 i32.const 128 - i32.const 274 + i32.const 285 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4640 + i32.const 5648 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9518,13 +9945,13 @@ if i32.const 0 i32.const 128 - i32.const 276 + i32.const 287 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4688 + i32.const 5696 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9541,13 +9968,13 @@ if i32.const 0 i32.const 128 - i32.const 278 + i32.const 289 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4736 + i32.const 5744 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9564,13 +9991,13 @@ if i32.const 0 i32.const 128 - i32.const 282 + i32.const 293 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4800 + i32.const 5808 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9587,13 +10014,13 @@ if i32.const 0 i32.const 128 - i32.const 286 + i32.const 297 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4880 + i32.const 5888 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9610,13 +10037,13 @@ if i32.const 0 i32.const 128 - i32.const 290 + i32.const 301 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4960 + i32.const 5968 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9633,13 +10060,13 @@ if i32.const 0 i32.const 128 - i32.const 293 + i32.const 304 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4992 + i32.const 6000 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9656,13 +10083,13 @@ if i32.const 0 i32.const 128 - i32.const 296 + i32.const 307 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 5024 + i32.const 6032 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9679,13 +10106,13 @@ if i32.const 0 i32.const 128 - i32.const 299 + i32.const 310 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 5056 + i32.const 6064 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9702,13 +10129,13 @@ if i32.const 0 i32.const 128 - i32.const 302 + i32.const 313 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4368 + i32.const 5376 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9725,13 +10152,13 @@ if i32.const 0 i32.const 128 - i32.const 305 + i32.const 316 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 5104 + i32.const 6112 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9748,13 +10175,13 @@ if i32.const 0 i32.const 128 - i32.const 308 + i32.const 319 i32.const 3 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - i32.const 4736 + i32.const 5744 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9771,7 +10198,7 @@ if i32.const 0 i32.const 128 - i32.const 311 + i32.const 322 i32.const 3 call $~lib/builtins/abort unreachable @@ -9796,7 +10223,7 @@ if i32.const 0 i32.const 128 - i32.const 329 + i32.const 340 i32.const 3 call $~lib/builtins/abort unreachable @@ -9809,7 +10236,7 @@ if i32.const 0 i32.const 128 - i32.const 330 + i32.const 341 i32.const 3 call $~lib/builtins/abort unreachable @@ -9822,7 +10249,7 @@ if i32.const 0 i32.const 128 - i32.const 332 + i32.const 343 i32.const 3 call $~lib/builtins/abort unreachable @@ -9835,7 +10262,7 @@ if i32.const 0 i32.const 128 - i32.const 333 + i32.const 344 i32.const 3 call $~lib/builtins/abort unreachable @@ -9848,7 +10275,7 @@ if i32.const 0 i32.const 128 - i32.const 335 + i32.const 346 i32.const 3 call $~lib/builtins/abort unreachable @@ -9861,7 +10288,7 @@ if i32.const 0 i32.const 128 - i32.const 336 + i32.const 347 i32.const 3 call $~lib/builtins/abort unreachable @@ -9874,7 +10301,7 @@ if i32.const 0 i32.const 128 - i32.const 338 + i32.const 349 i32.const 3 call $~lib/builtins/abort unreachable @@ -9887,7 +10314,7 @@ if i32.const 0 i32.const 128 - i32.const 339 + i32.const 350 i32.const 3 call $~lib/builtins/abort unreachable @@ -9899,7 +10326,7 @@ local.get $8 i32.store offset=4 local.get $8 - i32.const 5168 + i32.const 6176 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9910,7 +10337,7 @@ if i32.const 0 i32.const 128 - i32.const 341 + i32.const 352 i32.const 3 call $~lib/builtins/abort unreachable @@ -9922,7 +10349,7 @@ local.get $8 i32.store offset=4 local.get $8 - i32.const 5248 + i32.const 6256 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -9933,7 +10360,7 @@ if i32.const 0 i32.const 128 - i32.const 342 + i32.const 353 i32.const 3 call $~lib/builtins/abort unreachable @@ -9962,7 +10389,7 @@ if i32.const 0 i32.const 128 - i32.const 347 + i32.const 358 i32.const 3 call $~lib/builtins/abort unreachable @@ -9975,7 +10402,7 @@ if i32.const 0 i32.const 128 - i32.const 348 + i32.const 359 i32.const 3 call $~lib/builtins/abort unreachable @@ -9988,7 +10415,7 @@ if i32.const 0 i32.const 128 - i32.const 349 + i32.const 360 i32.const 3 call $~lib/builtins/abort unreachable @@ -10001,7 +10428,7 @@ if i32.const 0 i32.const 128 - i32.const 350 + i32.const 361 i32.const 3 call $~lib/builtins/abort unreachable @@ -10014,7 +10441,7 @@ if i32.const 0 i32.const 128 - i32.const 351 + i32.const 362 i32.const 3 call $~lib/builtins/abort unreachable @@ -10027,7 +10454,7 @@ if i32.const 0 i32.const 128 - i32.const 352 + i32.const 363 i32.const 3 call $~lib/builtins/abort unreachable @@ -10040,7 +10467,7 @@ if i32.const 0 i32.const 128 - i32.const 353 + i32.const 364 i32.const 3 call $~lib/builtins/abort unreachable @@ -10052,7 +10479,7 @@ local.get $8 i32.store offset=4 local.get $8 - i32.const 5328 + i32.const 6336 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -10063,7 +10490,7 @@ if i32.const 0 i32.const 128 - i32.const 355 + i32.const 366 i32.const 3 call $~lib/builtins/abort unreachable @@ -10075,7 +10502,7 @@ local.get $8 i32.store offset=4 local.get $8 - i32.const 5408 + i32.const 6416 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 @@ -10086,7 +10513,7 @@ if i32.const 0 i32.const 128 - i32.const 356 + i32.const 367 i32.const 3 call $~lib/builtins/abort unreachable @@ -10721,7 +11148,7 @@ i32.ge_u if i32.const 368 - i32.const 4464 + i32.const 5472 i32.const 92 i32.const 42 call $~lib/builtins/abort @@ -10745,8 +11172,8 @@ local.get $2 i32.eqz if - i32.const 4512 - i32.const 4464 + i32.const 5520 + i32.const 5472 i32.const 96 i32.const 40 call $~lib/builtins/abort From 35ff77490804f9e8c47ef4f252f307756f05c26a Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Wed, 28 Apr 2021 09:17:27 +0300 Subject: [PATCH 2/2] more inlines --- std/assembly/date.ts | 10 +- tests/compiler/std/date.optimized.wat | 295 +++++---- tests/compiler/std/date.untouched.wat | 840 +++++++++++++++----------- 3 files changed, 668 insertions(+), 477 deletions(-) diff --git a/std/assembly/date.ts b/std/assembly/date.ts index 3b69bcef6d..8f219b7100 100644 --- a/std/assembly/date.ts +++ b/std/assembly/date.ts @@ -99,7 +99,7 @@ export class Date { this.day = _day; } - getTime(): i64 { + @inline getTime(): i64 { return this.epochMillis; } @@ -114,19 +114,19 @@ export class Date { return time; } - getUTCFullYear(): i32 { + @inline getUTCFullYear(): i32 { return this.year; } - getUTCMonth(): i32 { + @inline getUTCMonth(): i32 { return this.month - 1; } - getUTCDate(): i32 { + @inline getUTCDate(): i32 { return this.day; } - getUTCDay(): i32 { + @inline getUTCDay(): i32 { return dayOfWeek(this.year, this.month, this.day); } diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index bdbd29bf9b..c57a4b1a4a 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -2415,15 +2415,6 @@ select i32.add ) - (func $~lib/date/Date#getUTCDay (param $0 i32) (result i32) - local.get $0 - i32.load - local.get $0 - i32.load offset=4 - local.get $0 - i32.load offset=8 - call $~lib/date/dayOfWeek - ) (func $~lib/number/I32#toString (param $0 i32) (result i32) (local $1 i32) (local $2 i32) @@ -4962,7 +4953,7 @@ (local $1 i64) (local $2 i32) global.get $~lib/memory/__stack_pointer - i32.const 24 + i32.const 36 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -4975,6 +4966,12 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store offset=16 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=24 + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store offset=32 block $folding-inner0 i32.const 1970 i32.const 1 @@ -5996,14 +5993,18 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i64.const 1467763200000 call $~lib/date/Date#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 + local.tee $0 i32.store offset=4 local.get $0 - call $~lib/date/Date#getUTCDay + i32.load + local.get $0 + i32.load offset=4 + local.get $0 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 3 i32.ne if @@ -6014,14 +6015,18 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i64.const 1467763199999 call $~lib/date/Date#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.store offset=8 local.get $0 - i32.store offset=4 + i32.load local.get $0 - call $~lib/date/Date#getUTCDay + i32.load offset=4 + local.get $0 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 2 i32.ne if @@ -6032,14 +6037,18 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i64.const 1467849599999 call $~lib/date/Date#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.store offset=12 local.get $0 - i32.store offset=4 + i32.load local.get $0 - call $~lib/date/Date#getUTCDay + i32.load offset=4 + local.get $0 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 3 i32.ne if @@ -6050,14 +6059,18 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i64.const 1467849600000 call $~lib/date/Date#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.store offset=16 local.get $0 - i32.store offset=4 + i32.load local.get $0 - call $~lib/date/Date#getUTCDay + i32.load offset=4 + local.get $0 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 4 i32.ne if @@ -6068,14 +6081,18 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i64.const 1468022400000 call $~lib/date/Date#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.store offset=20 local.get $0 - i32.store offset=4 + i32.load + local.get $0 + i32.load offset=4 local.get $0 - call $~lib/date/Date#getUTCDay + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 6 i32.ne if @@ -6086,14 +6103,18 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i64.const 1468022399999 call $~lib/date/Date#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.store offset=24 local.get $0 - i32.store offset=4 + i32.load + local.get $0 + i32.load offset=4 local.get $0 - call $~lib/date/Date#getUTCDay + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 5 i32.ne if @@ -6104,14 +6125,18 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i64.const 1468108799999 call $~lib/date/Date#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.store local.get $0 - i32.store offset=4 + i32.load + local.get $0 + i32.load offset=4 local.get $0 - call $~lib/date/Date#getUTCDay + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 6 i32.ne if @@ -6122,14 +6147,18 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i64.const 1468108800000 call $~lib/date/Date#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 + local.tee $0 i32.store offset=4 local.get $0 - call $~lib/date/Date#getUTCDay + i32.load + local.get $0 + i32.load offset=4 + local.get $0 + i32.load offset=8 + call $~lib/date/dayOfWeek if i32.const 0 i32.const 1152 @@ -6142,7 +6171,7 @@ i64.const 7899943856218720 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 i32.load offset=4 i32.const 4 @@ -6249,7 +6278,7 @@ i64.const 7941202527925698 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 i32.load i32.const 253616 @@ -6311,16 +6340,16 @@ i64.const -62167219200000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2160 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2160 call $~lib/string/String.__eq @@ -6337,16 +6366,16 @@ i64.const -62167219200001 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2240 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2240 call $~lib/string/String.__eq @@ -6363,16 +6392,16 @@ i64.const -62127219200000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2320 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2320 call $~lib/string/String.__eq @@ -6389,16 +6418,16 @@ i64.const 1231231231020 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2400 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2400 call $~lib/string/String.__eq @@ -6415,16 +6444,16 @@ i64.const 1231231231456 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2480 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2480 call $~lib/string/String.__eq @@ -6441,16 +6470,16 @@ i64.const 322331231231020 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2560 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2560 call $~lib/string/String.__eq @@ -6467,16 +6496,16 @@ i64.const 253402300799999 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2640 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2640 call $~lib/string/String.__eq @@ -6493,16 +6522,16 @@ i64.const 253402300800000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2720 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2720 call $~lib/string/String.__eq @@ -6519,16 +6548,16 @@ i64.const -62847038769226 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toISOString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 2800 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 2800 call $~lib/string/String.__eq @@ -6545,16 +6574,16 @@ i64.const -61536067200000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toDateString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 3648 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 3648 call $~lib/string/String.__eq @@ -6571,16 +6600,16 @@ i64.const 1580601600000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toDateString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 3712 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 3712 call $~lib/string/String.__eq @@ -6597,16 +6626,16 @@ i64.const -62183116800000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toDateString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 3776 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 3776 call $~lib/string/String.__eq @@ -6623,16 +6652,16 @@ i64.const -61536067200000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toTimeString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 3840 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 3840 call $~lib/string/String.__eq @@ -6649,16 +6678,16 @@ i64.const 253402300799999 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toTimeString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 3888 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 3888 call $~lib/string/String.__eq @@ -6675,16 +6704,16 @@ i64.const -61536067200000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toUTCString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 4704 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 4704 call $~lib/string/String.__eq @@ -6701,16 +6730,16 @@ i64.const 1580741613467 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toUTCString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 4784 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 4784 call $~lib/string/String.__eq @@ -6727,16 +6756,16 @@ i64.const -62183116800000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 local.get $0 call $~lib/date/Date#toUTCString local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 4864 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 4864 call $~lib/string/String.__eq @@ -6751,12 +6780,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 4944 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 4944 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 192067200000 @@ -6771,12 +6800,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5216 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5216 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 192067200000 @@ -6791,12 +6820,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5264 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5264 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 11860387200000 @@ -6811,12 +6840,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5312 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5312 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 192112496000 @@ -6831,12 +6860,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5376 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5376 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 192112496456 @@ -6851,12 +6880,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5456 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5456 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 192112496456 @@ -6871,12 +6900,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5536 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5536 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const -62167219200000 @@ -6891,12 +6920,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5568 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5568 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const -62135596800000 @@ -6911,12 +6940,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5600 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5600 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 189302400000 @@ -6931,12 +6960,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5632 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5632 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 191980800000 @@ -6951,12 +6980,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 4944 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 4944 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 192067200000 @@ -6971,12 +7000,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5680 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5680 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 192112440000 @@ -6991,12 +7020,12 @@ end global.get $~lib/memory/__stack_pointer i32.const 5312 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5312 call $~lib/date/Date.fromString local.tee $0 - i32.store + i32.store offset=4 local.get $0 i64.load offset=16 i64.const 192112496000 @@ -7013,12 +7042,12 @@ i64.const -8640000000000000 call $~lib/date/Date#constructor local.tee $0 - i32.store + i32.store offset=4 global.get $~lib/memory/__stack_pointer i64.const 8640000000000000 call $~lib/date/Date#constructor local.tee $2 - i32.store offset=12 + i32.store local.get $0 i64.load offset=16 i64.const -8640000000000000 @@ -7120,10 +7149,10 @@ local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5744 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 5744 call $~lib/string/String.__eq @@ -7141,10 +7170,10 @@ local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5824 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 5824 call $~lib/string/String.__eq @@ -7166,7 +7195,7 @@ i64.const -8639999999999999 call $~lib/date/Date#constructor local.tee $0 - i32.store offset=20 + i32.store offset=12 local.get $0 i32.load i32.const -271821 @@ -7250,10 +7279,10 @@ local.set $2 global.get $~lib/memory/__stack_pointer local.get $2 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5904 - i32.store offset=8 + i32.store offset=32 local.get $2 i32.const 5904 call $~lib/string/String.__eq @@ -7271,10 +7300,10 @@ local.set $0 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store offset=28 global.get $~lib/memory/__stack_pointer i32.const 5984 - i32.store offset=8 + i32.store offset=32 local.get $0 i32.const 5984 call $~lib/string/String.__eq @@ -7288,7 +7317,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - i32.const 24 + i32.const 36 i32.add global.set $~lib/memory/__stack_pointer return diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index 7f69bce24d..895ee4ae4c 100644 --- a/tests/compiler/std/date.untouched.wat +++ b/tests/compiler/std/date.untouched.wat @@ -16,7 +16,6 @@ (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) - (type $i32_=>_i64 (func (param i32) (result i64))) (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) (type $i32_i64_=>_i64 (func (param i32 i64) (result i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -2706,10 +2705,6 @@ local.get $1 i64.store offset=16 ) - (func $~lib/date/Date#getTime (param $0 i32) (result i64) - local.get $0 - i64.load offset=16 - ) (func $~lib/date/Date#setTime (param $0 i32) (param $1 i64) (result i64) (local $2 i64) (local $3 i64) @@ -2757,20 +2752,6 @@ call $~lib/date/Date#set:day local.get $1 ) - (func $~lib/date/Date#getUTCFullYear (param $0 i32) (result i32) - local.get $0 - i32.load - ) - (func $~lib/date/Date#getUTCMonth (param $0 i32) (result i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - ) - (func $~lib/date/Date#getUTCDate (param $0 i32) (result i32) - local.get $0 - i32.load offset=8 - ) (func $~lib/date/Date#getUTCHours (param $0 i32) (result i32) (local $1 i64) (local $2 i64) @@ -3184,15 +3165,6 @@ end i32.add ) - (func $~lib/date/Date#getUTCDay (param $0 i32) (result i32) - local.get $0 - i32.load - local.get $0 - i32.load offset=4 - local.get $0 - i32.load offset=8 - call $~lib/date/dayOfWeek - ) (func $~lib/util/number/decimalCount32 (param $0 i32) (result i32) local.get $0 i32.const 100000 @@ -7636,7 +7608,7 @@ (local $7 i64) (local $8 i32) global.get $~lib/memory/__stack_pointer - i32.const 24 + i32.const 36 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -7649,6 +7621,12 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store offset=16 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=24 + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store offset=32 i32.const 1970 local.set $2 i32.const 0 @@ -8116,7 +8094,9 @@ local.tee $1 i32.store local.get $1 - call $~lib/date/Date#getTime + local.set $0 + local.get $0 + i64.load offset=16 local.get $7 i64.eq i32.eqz @@ -8135,7 +8115,9 @@ call $~lib/date/Date#setTime drop local.get $1 - call $~lib/date/Date#getTime + local.set $6 + local.get $6 + i64.load offset=16 local.get $7 i64.const 1 i64.add @@ -8156,7 +8138,9 @@ local.tee $1 i32.store local.get $1 - call $~lib/date/Date#getUTCFullYear + local.set $5 + local.get $5 + i32.load i32.const 189512 i32.eq i32.eqz @@ -8169,7 +8153,11 @@ unreachable end local.get $1 - call $~lib/date/Date#getUTCMonth + local.set $4 + local.get $4 + i32.load offset=4 + i32.const 1 + i32.sub i32.const 11 i32.eq i32.eqz @@ -8182,7 +8170,9 @@ unreachable end local.get $1 - call $~lib/date/Date#getUTCDate + local.set $3 + local.get $3 + i32.load offset=8 i32.const 14 i32.eq i32.eqz @@ -8253,7 +8243,9 @@ local.tee $1 i32.store local.get $1 - call $~lib/date/Date#getUTCFullYear + local.set $2 + local.get $2 + i32.load i32.const 1973 i32.eq i32.eqz @@ -8266,7 +8258,11 @@ unreachable end local.get $1 - call $~lib/date/Date#getUTCMonth + local.set $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub i32.const 11 i32.eq i32.eqz @@ -8279,7 +8275,9 @@ unreachable end local.get $1 - call $~lib/date/Date#getUTCDate + local.set $6 + local.get $6 + i32.load offset=8 i32.const 4 i32.eq i32.eqz @@ -8398,7 +8396,9 @@ i32.const 0 call $~lib/date/Date#setUTCMilliseconds local.get $1 - call $~lib/date/Date#getTime + local.set $5 + local.get $5 + i64.load offset=16 i64.const 399464523963000 i64.eq i32.eqz @@ -8414,7 +8414,9 @@ i32.const 999 call $~lib/date/Date#setUTCMilliseconds local.get $1 - call $~lib/date/Date#getTime + local.set $4 + local.get $4 + i64.load offset=16 i64.const 399464523963999 i64.eq i32.eqz @@ -8443,7 +8445,9 @@ unreachable end local.get $1 - call $~lib/date/Date#getTime + local.set $3 + local.get $3 + i64.load offset=16 i64.const 399464523965000 i64.eq i32.eqz @@ -8472,7 +8476,9 @@ unreachable end local.get $1 - call $~lib/date/Date#getTime + local.set $2 + local.get $2 + i64.load offset=16 i64.const 399464523963000 i64.eq i32.eqz @@ -8539,7 +8545,9 @@ i32.const 0 call $~lib/date/Date#setUTCSeconds local.get $1 - call $~lib/date/Date#getTime + local.set $0 + local.get $0 + i64.load offset=16 i64.const 372027318300986 i64.eq i32.eqz @@ -8555,7 +8563,9 @@ i32.const 59 call $~lib/date/Date#setUTCSeconds local.get $1 - call $~lib/date/Date#getTime + local.set $6 + local.get $6 + i64.load offset=16 i64.const 372027318359986 i64.eq i32.eqz @@ -8622,7 +8632,9 @@ i32.const 0 call $~lib/date/Date#setUTCMinutes local.get $1 - call $~lib/date/Date#getTime + local.set $5 + local.get $5 + i64.load offset=16 i64.const 372027315631986 i64.eq i32.eqz @@ -8638,7 +8650,9 @@ i32.const 59 call $~lib/date/Date#setUTCMinutes local.get $1 - call $~lib/date/Date#getTime + local.set $4 + local.get $4 + i64.load offset=16 i64.const 372027319171986 i64.eq i32.eqz @@ -8705,7 +8719,9 @@ i32.const 0 call $~lib/date/Date#setUTCHours local.get $1 - call $~lib/date/Date#getTime + local.set $3 + local.get $3 + i64.load offset=16 i64.const 372027257131986 i64.eq i32.eqz @@ -8721,7 +8737,9 @@ i32.const 23 call $~lib/date/Date#setUTCHours local.get $1 - call $~lib/date/Date#getTime + local.set $2 + local.get $2 + i64.load offset=16 i64.const 372027339931986 i64.eq i32.eqz @@ -8740,7 +8758,9 @@ local.tee $1 i32.store local.get $1 - call $~lib/date/Date#getUTCFullYear + local.set $0 + local.get $0 + i32.load i32.const 1973 i32.eq i32.eqz @@ -8753,7 +8773,11 @@ unreachable end local.get $1 - call $~lib/date/Date#getUTCMonth + local.set $6 + local.get $6 + i32.load offset=4 + i32.const 1 + i32.sub i32.const 11 i32.eq i32.eqz @@ -8769,7 +8793,9 @@ i32.const 12 call $~lib/date/Date#setUTCDate local.get $1 - call $~lib/date/Date#getUTCDate + local.set $5 + local.get $5 + i32.load offset=8 i32.const 12 i32.eq i32.eqz @@ -8785,7 +8811,9 @@ i32.const 2 call $~lib/date/Date#setUTCDate local.get $1 - call $~lib/date/Date#getUTCDate + local.set $4 + local.get $4 + i32.load offset=8 i32.const 2 i32.eq i32.eqz @@ -8825,7 +8853,9 @@ i32.const 29 call $~lib/date/Date#setUTCDate local.get $1 - call $~lib/date/Date#getTime + local.set $3 + local.get $3 + i64.load offset=16 i64.const 1711674191274 i64.eq i32.eqz @@ -8838,7 +8868,9 @@ unreachable end local.get $1 - call $~lib/date/Date#getUTCDate + local.set $2 + local.get $2 + i32.load offset=8 i32.const 29 i32.eq i32.eqz @@ -8899,7 +8931,9 @@ i32.const 20 call $~lib/date/Date#setUTCDate local.get $1 - call $~lib/date/Date#getTime + local.set $0 + local.get $0 + i64.load offset=16 i64.const 1363748399999 i64.eq i32.eqz @@ -8915,7 +8949,9 @@ i32.const 1 call $~lib/date/Date#setUTCDate local.get $1 - call $~lib/date/Date#getTime + local.set $6 + local.get $6 + i64.load offset=16 i64.const 1362106799999 i64.eq i32.eqz @@ -8931,7 +8967,9 @@ i32.const 1000 call $~lib/date/Date#setUTCMilliseconds local.get $1 - call $~lib/date/Date#getTime + local.set $5 + local.get $5 + i64.load offset=16 i64.const 1362106800000 i64.eq i32.eqz @@ -8951,7 +8989,9 @@ i32.mul call $~lib/date/Date#setUTCMilliseconds local.get $1 - call $~lib/date/Date#getTime + local.set $4 + local.get $4 + i64.load offset=16 i64.const 1362110400000 i64.eq i32.eqz @@ -8973,7 +9013,9 @@ i32.add call $~lib/date/Date#setUTCMilliseconds local.get $1 - call $~lib/date/Date#getTime + local.set $3 + local.get $3 + i64.load offset=16 i64.const 1362114000001 i64.eq i32.eqz @@ -8995,7 +9037,9 @@ i32.add call $~lib/date/Date#setUTCMilliseconds local.get $1 - call $~lib/date/Date#getTime + local.set $2 + local.get $2 + i64.load offset=16 i64.const 1362117600001 i64.eq i32.eqz @@ -9017,7 +9061,9 @@ i32.const -2208 call $~lib/date/Date#setUTCDate local.get $1 - call $~lib/date/Date#getTime + local.set $0 + local.get $0 + i64.load offset=16 i64.const -67301808726 i64.eq i32.eqz @@ -9039,7 +9085,9 @@ i32.const 2208 call $~lib/date/Date#setUTCDate local.get $1 - call $~lib/date/Date#getTime + local.set $6 + local.get $6 + i64.load offset=16 i64.const 314240591274 i64.eq i32.eqz @@ -9051,15 +9099,19 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 1467763200000 call $~lib/date/Date#constructor - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 + local.tee $5 i32.store offset=4 - local.get $8 - call $~lib/date/Date#getUTCDay + local.get $5 + i32.load + local.get $5 + i32.load offset=4 + local.get $5 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 3 i32.eq i32.eqz @@ -9071,17 +9123,21 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 1467763200000 i64.const 1 i64.sub call $~lib/date/Date#constructor - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=4 - local.get $8 - call $~lib/date/Date#getUTCDay + local.tee $4 + i32.store offset=8 + local.get $4 + i32.load + local.get $4 + i32.load offset=4 + local.get $4 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 2 i32.eq i32.eqz @@ -9093,6 +9149,7 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 1467763200000 i64.const 86400000 @@ -9100,12 +9157,15 @@ i64.const 1 i64.sub call $~lib/date/Date#constructor - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=4 - local.get $8 - call $~lib/date/Date#getUTCDay + local.tee $3 + i32.store offset=12 + local.get $3 + i32.load + local.get $3 + i32.load offset=4 + local.get $3 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 3 i32.eq i32.eqz @@ -9117,17 +9177,21 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 1467763200000 i64.const 86400000 i64.add call $~lib/date/Date#constructor - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=4 - local.get $8 - call $~lib/date/Date#getUTCDay + local.tee $2 + i32.store offset=16 + local.get $2 + i32.load + local.get $2 + i32.load offset=4 + local.get $2 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 4 i32.eq i32.eqz @@ -9139,15 +9203,19 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 1468022400000 call $~lib/date/Date#constructor - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=4 - local.get $8 - call $~lib/date/Date#getUTCDay + local.tee $0 + i32.store offset=20 + local.get $0 + i32.load + local.get $0 + i32.load offset=4 + local.get $0 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 6 i32.eq i32.eqz @@ -9159,17 +9227,21 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 1468022400000 i64.const 1 i64.sub call $~lib/date/Date#constructor - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=4 - local.get $8 - call $~lib/date/Date#getUTCDay + local.tee $6 + i32.store offset=24 + local.get $6 + i32.load + local.get $6 + i32.load offset=4 + local.get $6 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 5 i32.eq i32.eqz @@ -9181,6 +9253,7 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 1468022400000 i64.const 86400000 @@ -9188,12 +9261,15 @@ i64.const 1 i64.sub call $~lib/date/Date#constructor - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=4 - local.get $8 - call $~lib/date/Date#getUTCDay + local.tee $1 + i32.store + local.get $1 + i32.load + local.get $1 + i32.load offset=4 + local.get $1 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 6 i32.eq i32.eqz @@ -9205,17 +9281,21 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 1468022400000 i64.const 86400000 i64.add call $~lib/date/Date#constructor - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 + local.tee $5 i32.store offset=4 - local.get $8 - call $~lib/date/Date#getUTCDay + local.get $5 + i32.load + local.get $5 + i32.load offset=4 + local.get $5 + i32.load offset=8 + call $~lib/date/dayOfWeek i32.const 0 i32.eq i32.eqz @@ -9231,26 +9311,34 @@ i32.const 0 i64.const 7899943856218720 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getUTCMonth - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 128 - i32.const 198 + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $4 + local.get $4 + i32.load offset=4 + i32.const 1 + i32.sub + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 198 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.const 10 call $~lib/date/Date#setUTCMonth - local.get $1 - call $~lib/date/Date#getUTCMonth + local.get $5 + local.set $3 + local.get $3 + i32.load offset=4 + i32.const 1 + i32.sub i32.const 10 i32.eq i32.eqz @@ -9262,11 +9350,15 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.const 2 call $~lib/date/Date#setUTCMonth - local.get $1 - call $~lib/date/Date#getUTCMonth + local.get $5 + local.set $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub i32.const 2 i32.eq i32.eqz @@ -9278,8 +9370,10 @@ call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/date/Date#getTime + local.get $5 + local.set $0 + local.get $0 + i64.load offset=16 i64.const 7899941177818720 i64.eq i32.eqz @@ -9291,14 +9385,16 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.const 1 call $~lib/date/Date#setUTCMonth - local.get $1 + local.get $5 i32.const 12 call $~lib/date/Date#setUTCMonth - local.get $1 - call $~lib/date/Date#getTime + local.get $5 + local.set $6 + local.get $6 + i64.load offset=16 i64.const 7899967616218720 i64.eq i32.eqz @@ -9310,11 +9406,13 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.const 0 call $~lib/date/Date#setUTCMonth + local.get $5 + local.set $1 local.get $1 - call $~lib/date/Date#getTime + i64.load offset=16 i64.const 7899967616218720 i64.eq i32.eqz @@ -9326,11 +9424,13 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.const 13 call $~lib/date/Date#setUTCMonth - local.get $1 - call $~lib/date/Date#getTime + local.get $5 + local.set $4 + local.get $4 + i64.load offset=16 i64.const 7900001830618720 i64.eq i32.eqz @@ -9346,10 +9446,12 @@ i32.const 0 i64.const 7941202527925698 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getUTCFullYear + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $3 + local.get $3 + i32.load i32.const 253616 i32.eq i32.eqz @@ -9361,11 +9463,13 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.const 1976 call $~lib/date/Date#setUTCFullYear - local.get $1 - call $~lib/date/Date#getUTCFullYear + local.get $5 + local.set $2 + local.get $2 + i32.load i32.const 1976 i32.eq i32.eqz @@ -9377,11 +9481,13 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.const 20212 call $~lib/date/Date#setUTCFullYear - local.get $1 - call $~lib/date/Date#getUTCFullYear + local.get $5 + local.set $0 + local.get $0 + i32.load i32.const 20212 i32.eq i32.eqz @@ -9393,11 +9499,13 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.const 71 call $~lib/date/Date#setUTCFullYear - local.get $1 - call $~lib/date/Date#getUTCFullYear + local.get $5 + local.set $6 + local.get $6 + i32.load i32.const 71 i32.eq i32.eqz @@ -9413,20 +9521,20 @@ i32.const 0 i64.const -62167219200000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 2592 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9444,20 +9552,20 @@ i64.const 1 i64.sub call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 2672 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9473,20 +9581,20 @@ i32.const 0 i64.const -62127219200000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 2752 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9502,20 +9610,20 @@ i32.const 0 i64.const 1231231231020 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 2832 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9531,20 +9639,20 @@ i32.const 0 i64.const 1231231231456 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 2912 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9560,20 +9668,20 @@ i32.const 0 i64.const 322331231231020 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 2992 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9589,20 +9697,20 @@ i32.const 0 i64.const 253402300799999 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 3072 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9618,20 +9726,20 @@ i32.const 0 i64.const 253402300800000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 3152 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9647,20 +9755,20 @@ i32.const 0 i64.const -62847038769226 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 3232 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9676,20 +9784,20 @@ i32.const 0 i64.const -61536067200000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toDateString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 4080 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9705,20 +9813,20 @@ i32.const 0 i64.const 1580601600000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toDateString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 4144 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9734,20 +9842,20 @@ i32.const 0 i64.const -62183116800000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toDateString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 4208 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9763,20 +9871,20 @@ i32.const 0 i64.const -61536067200000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toTimeString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 4272 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9792,20 +9900,20 @@ i32.const 0 i64.const 253402300799999 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toTimeString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 4320 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9821,20 +9929,20 @@ i32.const 0 i64.const -61536067200000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toUTCString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 5136 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9850,20 +9958,20 @@ i32.const 0 i64.const 1580741613467 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toUTCString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 5216 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9879,20 +9987,20 @@ i32.const 0 i64.const -62183116800000 call $~lib/date/Date#constructor - local.tee $1 - i32.store - local.get $1 + local.tee $5 + i32.store offset=4 + local.get $5 call $~lib/date/Date#toUTCString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 5296 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -9909,13 +10017,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $1 local.get $1 - call $~lib/date/Date#getTime + i64.load offset=16 i64.const 192067200000 i64.eq i32.eqz @@ -9932,13 +10042,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $4 + local.get $4 + i64.load offset=16 i64.const 192067200000 i64.eq i32.eqz @@ -9955,13 +10067,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $3 + local.get $3 + i64.load offset=16 i64.const 11860387200000 i64.eq i32.eqz @@ -9978,13 +10092,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $2 + local.get $2 + i64.load offset=16 i64.const 192112496000 i64.eq i32.eqz @@ -10001,13 +10117,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $0 + local.get $0 + i64.load offset=16 i64.const 192112496456 i64.eq i32.eqz @@ -10024,13 +10142,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $6 + local.get $6 + i64.load offset=16 i64.const 192112496456 i64.eq i32.eqz @@ -10047,13 +10167,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $1 local.get $1 - call $~lib/date/Date#getTime + i64.load offset=16 i64.const -62167219200000 i64.eq i32.eqz @@ -10070,13 +10192,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $4 + local.get $4 + i64.load offset=16 i64.const -62135596800000 i64.eq i32.eqz @@ -10093,13 +10217,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $3 + local.get $3 + i64.load offset=16 i64.const 189302400000 i64.eq i32.eqz @@ -10116,13 +10242,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $2 + local.get $2 + i64.load offset=16 i64.const 191980800000 i64.eq i32.eqz @@ -10139,13 +10267,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $0 + local.get $0 + i64.load offset=16 i64.const 192067200000 i64.eq i32.eqz @@ -10162,13 +10292,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store - local.get $1 - call $~lib/date/Date#getTime + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $6 + local.get $6 + i64.load offset=16 i64.const 192112440000 i64.eq i32.eqz @@ -10185,13 +10317,15 @@ local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 call $~lib/date/Date.fromString - local.tee $1 - i32.store + local.tee $5 + i32.store offset=4 + local.get $5 + local.set $1 local.get $1 - call $~lib/date/Date#getTime + i64.load offset=16 i64.const 192112496000 i64.eq i32.eqz @@ -10207,16 +10341,18 @@ i32.const 0 i64.const -8640000000000000 call $~lib/date/Date#constructor - local.tee $1 - i32.store + local.tee $5 + i32.store offset=4 global.get $~lib/memory/__stack_pointer i32.const 0 i64.const 8640000000000000 call $~lib/date/Date#constructor - local.tee $2 - i32.store offset=12 - local.get $1 - call $~lib/date/Date#getTime + local.tee $1 + i32.store + local.get $5 + local.set $4 + local.get $4 + i64.load offset=16 i64.const -8640000000000000 i64.eq i32.eqz @@ -10228,8 +10364,10 @@ call $~lib/builtins/abort unreachable end - local.get $2 - call $~lib/date/Date#getTime + local.get $1 + local.set $3 + local.get $3 + i64.load offset=16 i64.const 8640000000000000 i64.eq i32.eqz @@ -10241,8 +10379,10 @@ call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/date/Date#getUTCFullYear + local.get $5 + local.set $2 + local.get $2 + i32.load i32.const -271821 i32.eq i32.eqz @@ -10254,8 +10394,10 @@ call $~lib/builtins/abort unreachable end - local.get $2 - call $~lib/date/Date#getUTCFullYear + local.get $1 + local.set $0 + local.get $0 + i32.load i32.const 275760 i32.eq i32.eqz @@ -10267,8 +10409,12 @@ call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/date/Date#getUTCMonth + local.get $5 + local.set $6 + local.get $6 + i32.load offset=4 + i32.const 1 + i32.sub i32.const 3 i32.eq i32.eqz @@ -10280,8 +10426,12 @@ call $~lib/builtins/abort unreachable end - local.get $2 - call $~lib/date/Date#getUTCMonth + local.get $1 + local.set $4 + local.get $4 + i32.load offset=4 + i32.const 1 + i32.sub i32.const 8 i32.eq i32.eqz @@ -10293,8 +10443,10 @@ call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/date/Date#getUTCDate + local.get $5 + local.set $3 + local.get $3 + i32.load offset=8 i32.const 20 i32.eq i32.eqz @@ -10306,8 +10458,10 @@ call $~lib/builtins/abort unreachable end + local.get $1 + local.set $2 local.get $2 - call $~lib/date/Date#getUTCDate + i32.load offset=8 i32.const 13 i32.eq i32.eqz @@ -10319,18 +10473,18 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 6176 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -10342,18 +10496,18 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $1 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 6256 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -10371,7 +10525,7 @@ i64.const 1 i64.sub call $~lib/date/Date#constructor - local.tee $3 + local.tee $2 i32.store offset=16 global.get $~lib/memory/__stack_pointer i32.const 0 @@ -10379,10 +10533,12 @@ i64.const 1 i64.add call $~lib/date/Date#constructor - local.tee $4 - i32.store offset=20 - local.get $4 - call $~lib/date/Date#getUTCFullYear + local.tee $3 + i32.store offset=12 + local.get $3 + local.set $0 + local.get $0 + i32.load i32.const -271821 i32.eq i32.eqz @@ -10394,8 +10550,12 @@ call $~lib/builtins/abort unreachable end - local.get $4 - call $~lib/date/Date#getUTCMonth + local.get $3 + local.set $6 + local.get $6 + i32.load offset=4 + i32.const 1 + i32.sub i32.const 3 i32.eq i32.eqz @@ -10407,8 +10567,10 @@ call $~lib/builtins/abort unreachable end + local.get $3 + local.set $4 local.get $4 - call $~lib/date/Date#getUTCDate + i32.load offset=8 i32.const 20 i32.eq i32.eqz @@ -10420,7 +10582,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 call $~lib/date/Date#getUTCHours i32.const 0 i32.eq @@ -10433,7 +10595,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 call $~lib/date/Date#getUTCMinutes i32.const 0 i32.eq @@ -10446,7 +10608,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 call $~lib/date/Date#getUTCSeconds i32.const 0 i32.eq @@ -10459,7 +10621,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 call $~lib/date/Date#getUTCMilliseconds i32.const 1 i32.eq @@ -10472,18 +10634,18 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 6336 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -10495,18 +10657,18 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 call $~lib/date/Date#toISOString local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=4 + i32.store offset=28 local.get $8 i32.const 6416 local.set $8 global.get $~lib/memory/__stack_pointer local.get $8 - i32.store offset=8 + i32.store offset=32 local.get $8 call $~lib/string/String.__eq i32.eqz @@ -10519,7 +10681,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - i32.const 24 + i32.const 36 i32.add global.set $~lib/memory/__stack_pointer )