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:
ngeoffray@google.com 2013-01-17 11:24:31 +00:00
parent 8c5b198d95
commit 1fa01953e4
3 changed files with 9 additions and 4 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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;
}