X87: [turbofan] First step towards sanitizing for-in and making it optimizable.
authorchunyang.dai <chunyang.dai@intel.com>
Tue, 2 Jun 2015 09:07:13 +0000 (02:07 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 2 Jun 2015 09:07:27 +0000 (09:07 +0000)
port e2e47f30be06e6ea6b8a3cc90138381914ecd07d (r28711)

original commit message:

    [turbofan] First step towards sanitizing for-in and making it optimizable.

    In a nutshell: The FILTER_KEY builtin is gone, and was replaced by a
    simple runtime call to ForInFilter, which does everything and is even
    cheaper (because FILTER_KEY used to call into the runtime anyway).
    And ForInFilter returns either the name or undefined, which makes it
    possible to remove the control flow construction from the AstGraphBuilder,
    and thereby make both the initialization and the per-loop code of for-in
    optimizable later (in typed lowering).

BUG=

Review URL: https://codereview.chromium.org/1144143005

Cr-Commit-Position: refs/heads/master@{#28748}

src/x87/full-codegen-x87.cc

index edd2d83436775f3c7656c8f332d792d05a9050bf..ba7a2d4765f45650d28f9f2d16fb041268ee1341 100644 (file)
@@ -1190,9 +1190,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   // just skip it.
   __ push(ecx);  // Enumerable.
   __ push(ebx);  // Current entry.
-  __ InvokeBuiltin(Builtins::FILTER_KEY, CALL_FUNCTION);
+  __ CallRuntime(Runtime::kForInFilter, 2);
   PrepareForBailoutForId(stmt->FilterId(), TOS_REG);
-  __ test(eax, eax);
+  __ cmp(eax, isolate()->factory()->undefined_value());
   __ j(equal, loop_statement.continue_label());
   __ mov(ebx, eax);