Skip to content

Commit

Permalink
Only create FuncInfo in typed classes for fields with value initializers
Browse files Browse the repository at this point in the history
Summary:
The `ElementsInitFunction` means something different for typed vs legacy
classes. In typed classes, we know the shape of the object so we
preemptively emit an `AllocObjectLiteral` with the properties already
there, with default values. Therefore, when we encounter a field that
has no initializer, we don't need to create the `ElementsInitFunction`.

However, for legacy classes, we always need to be able to emit a
`DefineOwnPropertyInst` for any fields we encounter, including those
that do not have value initializers.

Reviewed By: avp

Differential Revision: D67115398

fbshipit-source-id: fc69db77b858480004e7530fc8e8105826cdcf3e
  • Loading branch information
fbmal7 authored and facebook-github-bot committed Dec 12, 2024
1 parent d1f7bb8 commit ea2face
Show file tree
Hide file tree
Showing 21 changed files with 153 additions and 230 deletions.
19 changes: 14 additions & 5 deletions lib/Sema/SemanticResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,10 +905,6 @@ void SemanticResolver::visit(ESTree::ClassPropertyNode *node) {
visitESTreeNode(*this, node->_key, node);
}

// Create the these initializers even if no value initializer is present.
FunctionInfo *functionInfo = node->_static
? curClassContext_->getOrCreateStaticElementsInitFunctionInfo()
: curClassContext_->getOrCreateInstanceElementsInitFunctionInfo();
// Visit the init expression, since it needs to be resolved.
if (node->_value) {
// We visit the initializer expression in the context of a synthesized
Expand All @@ -920,8 +916,21 @@ void SemanticResolver::visit(ESTree::ClassPropertyNode *node) {
// It is a Syntax Error if Initializer is present and ContainsArguments of
// Initializer is true.
llvh::SaveAndRestore<bool> oldForbidArguments{forbidArguments_, true};
FunctionContext funcCtx(*this, functionInfo);
FunctionContext funcCtx(
*this,
node->_static
? curClassContext_->getOrCreateStaticElementsInitFunctionInfo()
: curClassContext_->getOrCreateInstanceElementsInitFunctionInfo());
visitESTreeNode(*this, node->_value, node);
} else if (!typed_) {
// Create the these initializers even if no value initializer is present, in
// untyped mode. Typed classes don't need these initializers since we know
// the exact shape and construct it up front.
if (node->_static) {
curClassContext_->getOrCreateStaticElementsInitFunctionInfo();
} else {
curClassContext_->getOrCreateInstanceElementsInitFunctionInfo();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/flow/class-construct-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class C {

// Auto-generated content below. Please do not modify manually.

// CHECK:scope %VS0 [exports: any, foo: any, C: any, <fieldInitFuncVar:C>: object, ?C.prototype: object]
// CHECK:scope %VS0 [exports: any, foo: any, C: any, ?C.prototype: object]

// CHECK:scope %VS1 [x: any]

Expand Down
77 changes: 32 additions & 45 deletions test/IRGen/flow/class-super-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class B extends A {
// CHECK-NEXT: ReturnInst %7: any
// CHECK-NEXT:function_end

// CHECK:scope %VS1 [exports: any, A: any, B: any, <fieldInitFuncVar:A>: object, ?A.prototype: object, ?B.prototype: object]
// CHECK:scope %VS1 [exports: any, A: any, B: any, ?A.prototype: object, ?B.prototype: object]

// CHECK:function ""(exports: any): any
// CHECK-NEXT:%BB0:
Expand All @@ -58,92 +58,79 @@ class B extends A {
// CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS1.exports]: any
// CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.A]: any
// CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.B]: any
// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %<instance_members_initializer:A>(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.<fieldInitFuncVar:A>]: object
// CHECK-NEXT: %8 = CreateFunctionInst (:object) %1: environment, %A(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %8: object, [%VS1.A]: any
// CHECK-NEXT: %10 = CreateFunctionInst (:object) %1: environment, %f(): functionCode
// CHECK-NEXT: %11 = AllocObjectLiteralInst (:object) empty: any, "f": string, %10: object
// CHECK-NEXT: StoreFrameInst %1: environment, %11: object, [%VS1.?A.prototype]: object
// CHECK-NEXT: StorePropertyStrictInst %11: object, %8: object, "prototype": string
// CHECK-NEXT: %14 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any
// CHECK-NEXT: %15 = CheckedTypeCastInst (:object) %14: any, type(object)
// CHECK-NEXT: %16 = CreateFunctionInst (:object) %1: environment, %B(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %16: object, [%VS1.B]: any
// CHECK-NEXT: %18 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object
// CHECK-NEXT: %19 = CreateFunctionInst (:object) %1: environment, %"f 1#"(): functionCode
// CHECK-NEXT: %20 = AllocObjectLiteralInst (:object) empty: any, "f": string, %19: object
// CHECK-NEXT: TypedStoreParentInst %18: object, %20: object
// CHECK-NEXT: StoreFrameInst %1: environment, %20: object, [%VS1.?B.prototype]: object
// CHECK-NEXT: StorePropertyStrictInst %20: object, %16: object, "prototype": string
// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %A(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.A]: any
// CHECK-NEXT: %8 = CreateFunctionInst (:object) %1: environment, %f(): functionCode
// CHECK-NEXT: %9 = AllocObjectLiteralInst (:object) empty: any, "f": string, %8: object
// CHECK-NEXT: StoreFrameInst %1: environment, %9: object, [%VS1.?A.prototype]: object
// CHECK-NEXT: StorePropertyStrictInst %9: object, %6: object, "prototype": string
// CHECK-NEXT: %12 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any
// CHECK-NEXT: %13 = CheckedTypeCastInst (:object) %12: any, type(object)
// CHECK-NEXT: %14 = CreateFunctionInst (:object) %1: environment, %B(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %14: object, [%VS1.B]: any
// CHECK-NEXT: %16 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object
// CHECK-NEXT: %17 = CreateFunctionInst (:object) %1: environment, %"f 1#"(): functionCode
// CHECK-NEXT: %18 = AllocObjectLiteralInst (:object) empty: any, "f": string, %17: object
// CHECK-NEXT: TypedStoreParentInst %16: object, %18: object
// CHECK-NEXT: StoreFrameInst %1: environment, %18: object, [%VS1.?B.prototype]: object
// CHECK-NEXT: StorePropertyStrictInst %18: object, %14: object, "prototype": string
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:scope %VS2 []

// CHECK:function <instance_members_initializer:A>(): undefined
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS2: any, %0: environment
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:scope %VS3 [x: any]
// CHECK:scope %VS2 [x: any]

// CHECK:constructor A(x: number): any [typed]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = LoadParamInst (:object) %<this>: object
// CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS3: any, %1: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS2: any, %1: environment
// CHECK-NEXT: %3 = LoadParamInst (:number) %x: number
// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS3.x]: any
// CHECK-NEXT: %5 = LoadFrameInst (:object) %1: environment, [%VS1.<fieldInitFuncVar:A>]: object
// CHECK-NEXT: %6 = CallInst (:undefined) %5: object, %<instance_members_initializer:A>(): functionCode, true: boolean, empty: any, undefined: undefined, %0: object
// CHECK-NEXT: %7 = LoadFrameInst (:any) %2: environment, [%VS3.x]: any
// CHECK-NEXT: %8 = CheckedTypeCastInst (:number) %7: any, type(number)
// CHECK-NEXT: PrStoreInst %8: number, %0: object, 0: number, "x": string, true: boolean
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS2.x]: any
// CHECK-NEXT: %5 = LoadFrameInst (:any) %2: environment, [%VS2.x]: any
// CHECK-NEXT: %6 = CheckedTypeCastInst (:number) %5: any, type(number)
// CHECK-NEXT: PrStoreInst %6: number, %0: object, 0: number, "x": string, true: boolean
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:scope %VS4 []
// CHECK:scope %VS3 []

// CHECK:function f(): any [typed]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = LoadParamInst (:object) %<this>: object
// CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS4: any, %1: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS3: any, %1: environment
// CHECK-NEXT: %3 = PrLoadInst (:number) %0: object, 0: number, "x": string
// CHECK-NEXT: %4 = BinaryMultiplyInst (:any) %3: number, 10: number
// CHECK-NEXT: %5 = CheckedTypeCastInst (:number) %4: any, type(number)
// CHECK-NEXT: ReturnInst %5: number
// CHECK-NEXT:function_end

// CHECK:scope %VS5 [x: any]
// CHECK:scope %VS4 [x: any]

// CHECK:constructor B(x: number): any [typed]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = LoadParamInst (:object) %<this>: object
// CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS5: any, %1: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS4: any, %1: environment
// CHECK-NEXT: %3 = LoadParamInst (:number) %x: number
// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS5.x]: any
// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS4.x]: any
// CHECK-NEXT: %5 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any
// CHECK-NEXT: %6 = CheckedTypeCastInst (:object) %5: any, type(object)
// CHECK-NEXT: %7 = GetNewTargetInst (:object) %new.target: object
// CHECK-NEXT: %8 = LoadFrameInst (:any) %2: environment, [%VS5.x]: any
// CHECK-NEXT: %8 = LoadFrameInst (:any) %2: environment, [%VS4.x]: any
// CHECK-NEXT: %9 = CheckedTypeCastInst (:number) %8: any, type(number)
// CHECK-NEXT: %10 = CallInst [njsf] (:any) %6: object, empty: any, false: boolean, empty: any, %7: object, %0: object, %9: number
// CHECK-NEXT: %11 = CheckedTypeCastInst (:undefined) %10: any, type(undefined)
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:scope %VS6 []
// CHECK:scope %VS5 []

// CHECK:function "f 1#"(): any [typed]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = LoadParamInst (:object) %<this>: object
// CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS6: any, %1: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS5: any, %1: environment
// CHECK-NEXT: %3 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object
// CHECK-NEXT: %4 = PrLoadInst (:object) %3: object, 0: number, "f": string
// CHECK-NEXT: %5 = CallInst [njsf] (:any) %4: object, empty: any, false: boolean, empty: any, undefined: undefined, %0: object
Expand Down
71 changes: 29 additions & 42 deletions test/IRGen/flow/class-super-prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class B extends A {
// CHECK-NEXT: ReturnInst %7: any
// CHECK-NEXT:function_end

// CHECK:scope %VS1 [exports: any, A: any, B: any, <fieldInitFuncVar:A>: object, ?A.prototype: object, ?B.prototype: object]
// CHECK:scope %VS1 [exports: any, A: any, B: any, ?A.prototype: object, ?B.prototype: object]

// CHECK:function ""(exports: any): any
// CHECK-NEXT:%BB0:
Expand All @@ -54,78 +54,65 @@ class B extends A {
// CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS1.exports]: any
// CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.A]: any
// CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.B]: any
// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %<instance_members_initializer:A>(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.<fieldInitFuncVar:A>]: object
// CHECK-NEXT: %8 = CreateFunctionInst (:object) %1: environment, %A(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %8: object, [%VS1.A]: any
// CHECK-NEXT: %10 = AllocObjectLiteralInst (:object) empty: any
// CHECK-NEXT: StoreFrameInst %1: environment, %10: object, [%VS1.?A.prototype]: object
// CHECK-NEXT: StorePropertyStrictInst %10: object, %8: object, "prototype": string
// CHECK-NEXT: %13 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any
// CHECK-NEXT: %14 = CheckedTypeCastInst (:object) %13: any, type(object)
// CHECK-NEXT: %15 = CreateFunctionInst (:object) %1: environment, %B(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %15: object, [%VS1.B]: any
// CHECK-NEXT: %17 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object
// CHECK-NEXT: %18 = CreateFunctionInst (:object) %1: environment, %f(): functionCode
// CHECK-NEXT: %19 = AllocObjectLiteralInst (:object) empty: any, "f": string, %18: object
// CHECK-NEXT: TypedStoreParentInst %17: object, %19: object
// CHECK-NEXT: StoreFrameInst %1: environment, %19: object, [%VS1.?B.prototype]: object
// CHECK-NEXT: StorePropertyStrictInst %19: object, %15: object, "prototype": string
// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %A(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.A]: any
// CHECK-NEXT: %8 = AllocObjectLiteralInst (:object) empty: any
// CHECK-NEXT: StoreFrameInst %1: environment, %8: object, [%VS1.?A.prototype]: object
// CHECK-NEXT: StorePropertyStrictInst %8: object, %6: object, "prototype": string
// CHECK-NEXT: %11 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any
// CHECK-NEXT: %12 = CheckedTypeCastInst (:object) %11: any, type(object)
// CHECK-NEXT: %13 = CreateFunctionInst (:object) %1: environment, %B(): functionCode
// CHECK-NEXT: StoreFrameInst %1: environment, %13: object, [%VS1.B]: any
// CHECK-NEXT: %15 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object
// CHECK-NEXT: %16 = CreateFunctionInst (:object) %1: environment, %f(): functionCode
// CHECK-NEXT: %17 = AllocObjectLiteralInst (:object) empty: any, "f": string, %16: object
// CHECK-NEXT: TypedStoreParentInst %15: object, %17: object
// CHECK-NEXT: StoreFrameInst %1: environment, %17: object, [%VS1.?B.prototype]: object
// CHECK-NEXT: StorePropertyStrictInst %17: object, %13: object, "prototype": string
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:scope %VS2 []

// CHECK:function <instance_members_initializer:A>(): undefined
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS2: any, %0: environment
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:scope %VS3 [x: any]
// CHECK:scope %VS2 [x: any]

// CHECK:constructor A(x: number): any [typed]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = LoadParamInst (:object) %<this>: object
// CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS3: any, %1: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS2: any, %1: environment
// CHECK-NEXT: %3 = LoadParamInst (:number) %x: number
// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS3.x]: any
// CHECK-NEXT: %5 = LoadFrameInst (:object) %1: environment, [%VS1.<fieldInitFuncVar:A>]: object
// CHECK-NEXT: %6 = CallInst (:undefined) %5: object, %<instance_members_initializer:A>(): functionCode, true: boolean, empty: any, undefined: undefined, %0: object
// CHECK-NEXT: %7 = LoadFrameInst (:any) %2: environment, [%VS3.x]: any
// CHECK-NEXT: %8 = CheckedTypeCastInst (:number) %7: any, type(number)
// CHECK-NEXT: PrStoreInst %8: number, %0: object, 0: number, "x": string, true: boolean
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS2.x]: any
// CHECK-NEXT: %5 = LoadFrameInst (:any) %2: environment, [%VS2.x]: any
// CHECK-NEXT: %6 = CheckedTypeCastInst (:number) %5: any, type(number)
// CHECK-NEXT: PrStoreInst %6: number, %0: object, 0: number, "x": string, true: boolean
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:scope %VS4 [x: any]
// CHECK:scope %VS3 [x: any]

// CHECK:constructor B(x: number): any [typed]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = LoadParamInst (:object) %<this>: object
// CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS4: any, %1: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS3: any, %1: environment
// CHECK-NEXT: %3 = LoadParamInst (:number) %x: number
// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS4.x]: any
// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS3.x]: any
// CHECK-NEXT: %5 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any
// CHECK-NEXT: %6 = CheckedTypeCastInst (:object) %5: any, type(object)
// CHECK-NEXT: %7 = GetNewTargetInst (:object) %new.target: object
// CHECK-NEXT: %8 = LoadFrameInst (:any) %2: environment, [%VS4.x]: any
// CHECK-NEXT: %8 = LoadFrameInst (:any) %2: environment, [%VS3.x]: any
// CHECK-NEXT: %9 = CheckedTypeCastInst (:number) %8: any, type(number)
// CHECK-NEXT: %10 = CallInst [njsf] (:any) %6: object, empty: any, false: boolean, empty: any, %7: object, %0: object, %9: number
// CHECK-NEXT: %11 = CheckedTypeCastInst (:undefined) %10: any, type(undefined)
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:scope %VS5 []
// CHECK:scope %VS4 []

// CHECK:function f(): any [typed]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = LoadParamInst (:object) %<this>: object
// CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS5: any, %1: environment
// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS4: any, %1: environment
// CHECK-NEXT: %3 = PrLoadInst (:number) %0: object, 0: number, "x": string
// CHECK-NEXT: ReturnInst %3: number
// CHECK-NEXT:function_end
14 changes: 3 additions & 11 deletions test/Optimizer/flow/inline-constructor-small.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,9 @@ print(p1.x, p2.x);
// CHECK-NEXT: %1 = CreateFunctionInst (:object) %0: environment, %Point(): functionCode
// CHECK-NEXT: %2 = AllocObjectLiteralInst (:object) empty: any
// CHECK-NEXT: StorePropertyStrictInst %2: object, %1: object, "prototype": string
// CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any, "x": string, 0: number, "y": string, 0: number
// CHECK-NEXT: TypedStoreParentInst %2: object, %4: object
// CHECK-NEXT: %6 = CallInst (:undefined) %1: object, %Point(): functionCode, true: boolean, empty: any, %1: object, %4: object, 1: number, 2: number
// CHECK-NEXT: %7 = AllocObjectLiteralInst (:object) empty: any, "x": string, 0: number, "y": string, 0: number
// CHECK-NEXT: TypedStoreParentInst %2: object, %7: object
// CHECK-NEXT: %9 = CallInst (:undefined) %1: object, %Point(): functionCode, true: boolean, empty: any, %1: object, %7: object, 3: number, 4: number
// CHECK-NEXT: %10 = TryLoadGlobalPropertyInst (:any) globalObject: object, "print": string
// CHECK-NEXT: %11 = PrLoadInst (:number) %4: object, 0: number, "x": string
// CHECK-NEXT: %12 = PrLoadInst (:number) %7: object, 0: number, "x": string
// CHECK-NEXT: %13 = CallInst (:any) %10: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %11: number, %12: number
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT: %4 = TryLoadGlobalPropertyInst (:any) globalObject: object, "print": string
// CHECK-NEXT: %5 = CallInst (:any) %4: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, 1: number, 3: number
// CHECK-NEXT: ReturnInst undefined: undefined
// CHECK-NEXT:function_end

// CHECK:constructor Point(x: number, y: number): undefined [typed]
Expand Down
Loading

0 comments on commit ea2face

Please sign in to comment.