You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With this change we support defining methods on classes and objects
with non-identifier names, like number and string literals.
Internally, all method names remain strings, reusing any type
information. At lifting, we approximate simple identifiers and
use them unquoted for method definition and for usage in dot
notation. For definitions, we also support quoted strings and
unquoted index values. At call sites, we ensure bracket notation
where needed, supporting index access without quotes.
This covers method names for plain objects and classes.
This does not cover properties, getters and setters yet.
We also add 2 custom method names to the environment that don't
follow the previous identifier naming.
Instructions that define such methods currently are:
ObjectLiteralMethod
ClassInstanceMethod
ClassStaticMethod
Instructions that use such methods are:
CallMethod
CallMethodWithSpread
CallSuperMethod
BindMethod
We ignore definitions and calls of private methods. They also reuse
the same typer logic, but naming rules are more strict here,
non-identifiers are not supported and should never be produced. We
need to separate now identifiers for private and other method names
in the JS environment.
This also extends the compiler to enable importing the new method
types.
Bug: 446634535
Change-Id: I2b8fbb8306e4b6bd901b61952c6da91d4210ae3f
Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9047716
Reviewed-by: Dominik Klemba <tacet@google.com>
Reviewed-by: Matthias Liedtke <mliedtke@google.com>
Commit-Queue: Michael Achenbach <machenbach@google.com>
Copy file name to clipboardExpand all lines: Sources/Fuzzilli/Lifting/JavaScriptLifter.swift
+27-11Lines changed: 27 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ public class JavaScriptLifter: Lifter {
34
34
letversion:ECMAScriptVersion
35
35
36
36
/// This environment is used if we need to re-type a program before we compile Wasm code.
37
-
privatevarenvironment:JavaScriptEnvironment?
37
+
privatevarenvironment:JavaScriptEnvironment
38
38
39
39
/// Counter to assist the lifter in detecting nested CodeStrings
40
40
privatevarcodeStringNestingLevel=0
@@ -78,7 +78,7 @@ public class JavaScriptLifter: Lifter {
78
78
publicinit(prefix:String="",
79
79
suffix:String="",
80
80
ecmaVersion:ECMAScriptVersion,
81
-
environment:JavaScriptEnvironment?=nil,
81
+
environment:JavaScriptEnvironment,
82
82
alwaysEmitVariables:Bool=false){
83
83
self.prefix = prefix
84
84
self.suffix = suffix
@@ -131,7 +131,7 @@ public class JavaScriptLifter: Lifter {
131
131
132
132
if needToSupportWasm {
133
133
// If we need to support Wasm we need to type all instructions outside of Wasm such that the WasmLifter can access extra type information during lifting.
0 commit comments