mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Remove intrinsic Root::r()
This commit is contained in:
parent
51bcf516c8
commit
0b3ab875f4
55 changed files with 275 additions and 310 deletions
|
@ -3256,12 +3256,7 @@ class CGPerSignatureCall(CGThing):
|
|||
return "argc"
|
||||
|
||||
def getArguments(self):
|
||||
def process(arg, i):
|
||||
argVal = "arg" + str(i)
|
||||
if arg.type.isGeckoInterface() and not arg.type.unroll().inner.isCallback():
|
||||
argVal += ".r()"
|
||||
return argVal
|
||||
return [(a, process(a, i)) for (i, a) in enumerate(self.arguments)]
|
||||
return [(a, process_arg("arg" + str(i), a)) for (i, a) in enumerate(self.arguments)]
|
||||
|
||||
def isFallible(self):
|
||||
return 'infallible' not in self.extendedAttributes
|
||||
|
@ -4651,12 +4646,7 @@ class CGProxySpecialOperation(CGPerSignatureCall):
|
|||
self.cgRoot.prepend(CGGeneric("rooted!(in(cx) let value = desc.value);"))
|
||||
|
||||
def getArguments(self):
|
||||
def process(arg):
|
||||
argVal = arg.identifier.name
|
||||
if arg.type.isGeckoInterface() and not arg.type.unroll().inner.isCallback():
|
||||
argVal += ".r()"
|
||||
return argVal
|
||||
args = [(a, process(a)) for a in self.arguments]
|
||||
args = [(a, process_arg(a.identifier.name, a)) for a in self.arguments]
|
||||
return args
|
||||
|
||||
def wrap_return_value(self):
|
||||
|
@ -6775,6 +6765,15 @@ def camel_to_upper_snake(s):
|
|||
return "_".join(m.group(0).upper() for m in re.finditer("[A-Z][a-z]*", s))
|
||||
|
||||
|
||||
def process_arg(expr, arg):
|
||||
if arg.type.isGeckoInterface() and not arg.type.unroll().inner.isCallback():
|
||||
if arg.type.nullable() or arg.type.isSequence() or arg.optional:
|
||||
expr += ".r()"
|
||||
else:
|
||||
expr = "&" + expr
|
||||
return expr
|
||||
|
||||
|
||||
class GlobalGenRoots():
|
||||
"""
|
||||
Roots for global codegen.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue