-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing devirtualization of ClassGetVirtual for vacuous case
- Loading branch information
Showing
22 changed files
with
722 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
//@execute 0=18 | ||
|
||
var global = 0; | ||
|
||
class Base { | ||
def m() { global = 18; } | ||
} | ||
|
||
class A extends Base { | ||
} | ||
|
||
class A1 extends A { | ||
def m() { global = 19; } | ||
} | ||
|
||
class A2 extends A { | ||
} | ||
|
||
class B extends Base { | ||
def m() { global = 20; } | ||
} | ||
|
||
class B1 extends B { | ||
def m() { global = 21; } | ||
} | ||
|
||
class B2 extends B { | ||
} | ||
|
||
def run(f: void -> void) { | ||
f(); | ||
} | ||
|
||
def dispatch(obj: Base) { | ||
match (obj) { | ||
x: A1 => run(x.m); | ||
x: A2 => run(x.m); | ||
x: A => run(x.m); | ||
x: B1 => run(x.m); | ||
x: B2 => run(x.m); | ||
x: B => run(x.m); | ||
x: Base => run(x.m); | ||
} | ||
} | ||
|
||
def objs = [ | ||
Base.new() | ||
]; | ||
|
||
def main(a: int) -> int { | ||
global = 0; | ||
dispatch(objs[a]); | ||
return global; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//@execute 0=18 | ||
|
||
var global = 0; | ||
|
||
class Base { | ||
def m() { global = 18; } | ||
} | ||
|
||
class A extends Base { | ||
} | ||
|
||
class A1 extends A { | ||
def m() { global = 19; } | ||
} | ||
|
||
class A2 extends A { | ||
} | ||
|
||
def run(f: void -> void) { | ||
f(); | ||
} | ||
|
||
def dispatch(obj: Base) { | ||
match (obj) { | ||
x: A1 => run(x.m); | ||
x: A2 => run(x.m); | ||
x: A => run(x.m); | ||
x: Base => run(x.m); | ||
} | ||
} | ||
|
||
def objs = [ | ||
Base.new() | ||
]; | ||
|
||
def main(a: int) -> int { | ||
global = 0; | ||
dispatch(objs[a]); | ||
return global; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//@execute 0=18 | ||
|
||
var global = 0; | ||
|
||
class Base { | ||
def m() { global = 18; } | ||
} | ||
|
||
class A extends Base { | ||
} | ||
|
||
class A1 extends A { | ||
def m() { global = 19; } | ||
} | ||
|
||
class A2 extends A { | ||
} | ||
|
||
class B extends Base { | ||
def m() { global = 20; } | ||
} | ||
|
||
class B1 extends B { | ||
def m() { global = 21; } | ||
} | ||
|
||
def run(f: void -> void) { | ||
f(); | ||
} | ||
|
||
def dispatch(obj: Base) { | ||
match (obj) { | ||
x: A1 => run(x.m); | ||
x: A2 => run(x.m); | ||
x: A => run(x.m); | ||
x: B1 => run(x.m); | ||
x: B => run(x.m); | ||
x: Base => run(x.m); | ||
} | ||
} | ||
|
||
def objs = [ | ||
Base.new() | ||
]; | ||
|
||
def main(a: int) -> int { | ||
global = 0; | ||
dispatch(objs[a]); | ||
return global; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//@execute 0=18 | ||
|
||
var global = 0; | ||
|
||
class Base { | ||
def m() { global = 18; } | ||
} | ||
|
||
class A extends Base { | ||
} | ||
|
||
class A1 extends A { | ||
def m() { global = 19; } | ||
} | ||
|
||
class B extends Base { | ||
def m() { global = 20; } | ||
} | ||
|
||
class B1 extends B { | ||
def m() { global = 21; } | ||
} | ||
|
||
def run(f: void -> void) { | ||
f(); | ||
} | ||
|
||
def dispatch(obj: Base) { | ||
match (obj) { | ||
x: A1 => run(x.m); | ||
x: A => run(x.m); | ||
x: B1 => run(x.m); | ||
x: B => run(x.m); | ||
x: Base => run(x.m); | ||
} | ||
} | ||
|
||
def objs = [ | ||
Base.new() | ||
]; | ||
|
||
def main(a: int) -> int { | ||
global = 0; | ||
dispatch(objs[a]); | ||
return global; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//@execute 0=18 | ||
|
||
var global = 0; | ||
|
||
class Base { | ||
def m() { global = 18; } | ||
} | ||
|
||
class A extends Base { | ||
} | ||
|
||
class A1 extends A { | ||
def m() { global = 19; } | ||
} | ||
|
||
class B extends Base { | ||
def m() { global = 20; } | ||
} | ||
|
||
class B1 extends B { | ||
} | ||
|
||
def run(f: void -> void) { | ||
f(); | ||
} | ||
|
||
def dispatch(obj: Base) { | ||
match (obj) { | ||
x: A1 => run(x.m); | ||
x: A => run(x.m); | ||
x: B1 => run(x.m); | ||
x: B => run(x.m); | ||
x: Base => run(x.m); | ||
} | ||
} | ||
|
||
def objs = [ | ||
Base.new() | ||
]; | ||
|
||
def main(a: int) -> int { | ||
global = 0; | ||
dispatch(objs[a]); | ||
return global; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//@execute 0=18 | ||
|
||
var global = 0; | ||
|
||
class Base { | ||
def m() { global = 18; } | ||
} | ||
|
||
class A extends Base { | ||
} | ||
|
||
class A1 extends A { | ||
def m() { global = 19; } | ||
} | ||
|
||
class B extends Base { | ||
def m() { global = 20; } | ||
} | ||
|
||
def run(f: void -> void) { | ||
f(); | ||
} | ||
|
||
def dispatch(obj: Base) { | ||
match (obj) { | ||
x: A1 => run(x.m); | ||
x: A => run(x.m); | ||
x: B => run(x.m); | ||
x: Base => run(x.m); | ||
} | ||
} | ||
|
||
def objs = [ | ||
Base.new() | ||
]; | ||
|
||
def main(a: int) -> int { | ||
global = 0; | ||
dispatch(objs[a]); | ||
return global; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//@execute 0=18 | ||
|
||
var global = 0; | ||
|
||
class Base { | ||
def m() { global = 18; } | ||
} | ||
|
||
class A extends Base { | ||
} | ||
|
||
class A1 extends A { | ||
def m() { global = 19; } | ||
} | ||
|
||
class B extends Base { | ||
} | ||
|
||
class B1 extends B { | ||
def m() { global = 21; } | ||
} | ||
|
||
def run(f: void -> void) { | ||
f(); | ||
} | ||
|
||
def dispatch(obj: Base) { | ||
match (obj) { | ||
x: A1 => run(x.m); | ||
x: A => run(x.m); | ||
x: B1 => run(x.m); | ||
x: B => run(x.m); | ||
x: Base => run(x.m); | ||
} | ||
} | ||
|
||
def objs = [ | ||
Base.new() | ||
]; | ||
|
||
def main(a: int) -> int { | ||
global = 0; | ||
dispatch(objs[a]); | ||
return global; | ||
} |
Oops, something went wrong.