mirror of
https://github.com/dart-lang/sdk
synced 2024-10-05 03:15:01 +00:00
Avoid trying to inline identical, and avoid shadowing identical.
Review URL: https://codereview.chromium.org//11855016 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17191 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
8c5b198d95
commit
1fa01953e4
|
@ -253,4 +253,6 @@ patch class RegExp {
|
|||
}
|
||||
|
||||
// Patch for 'identical' function.
|
||||
patch bool identical(Object a, Object b) => Primitives.identical(a, b);
|
||||
patch bool identical(Object a, Object b) {
|
||||
return Primitives.identicalImplementation(a, b);
|
||||
}
|
||||
|
|
|
@ -735,7 +735,7 @@ class Primitives {
|
|||
return JS('var', r'$[#]', className);
|
||||
}
|
||||
|
||||
static bool identical(a, b) {
|
||||
static bool identicalImplementation(a, b) {
|
||||
return JS('bool', '# == null', a)
|
||||
? JS('bool', '# == null', b)
|
||||
: JS('bool', '# === #', a, b);
|
||||
|
|
|
@ -3435,7 +3435,10 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
|||
}
|
||||
compiler.ensure(!element.isGenerativeConstructor());
|
||||
if (element.isFunction()) {
|
||||
if (tryInlineMethod(element, selector, node.arguments)) {
|
||||
bool isIdenticalFunction = element == compiler.identicalFunction;
|
||||
|
||||
if (!isIdenticalFunction
|
||||
&& tryInlineMethod(element, selector, node.arguments)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3452,7 +3455,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
|||
return;
|
||||
}
|
||||
|
||||
if (identical(element, compiler.identicalFunction)) {
|
||||
if (isIdenticalFunction) {
|
||||
pushWithPosition(new HIdentity(target, inputs[1], inputs[2]), node);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue