[date] Refactor the %_DateField intrinsic to be optimizable.
authorbmeurer <bmeurer@chromium.org>
Wed, 3 Jun 2015 08:31:15 +0000 (01:31 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Jun 2015 08:31:27 +0000 (08:31 +0000)
commite4782a9b468258344d512a5f7dadbf1584928849
tree6402a3607a556d8bf7367954f1a536ca0ae7feb4
parent525955037a371d366a63e5b959a9dba2eba9225e
[date] Refactor the %_DateField intrinsic to be optimizable.

Previously the %_DateField intrinsic would also check the object and
throw an exception if you happen to pass something that is not a valid
JSDate, which (a) violates our policy for instrinsics and (b) is hard to
optimize in TurboFan (even Crankshaft has a hard time, but there we will
never inline the relevant builtins, so it doesn't show up). The throwing
part is now a separate intrinsics %_ThrowIfNotADate that throws an
exception in full codegen and deoptimizes in Crankshaft, which means the
code for the current use cases is roughly the same (modulo some register
renamings/gap moves).

R=jkummerow@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28782}
30 files changed:
src/arm/full-codegen-arm.cc
src/arm/lithium-arm.cc
src/arm/lithium-codegen-arm.cc
src/arm64/full-codegen-arm64.cc
src/arm64/lithium-arm64.cc
src/arm64/lithium-codegen-arm64.cc
src/bailout-reason.h
src/compiler/linkage.cc
src/date.js
src/deoptimizer.h
src/full-codegen.h
src/hydrogen-instructions.cc
src/hydrogen-instructions.h
src/hydrogen.cc
src/hydrogen.h
src/ia32/full-codegen-ia32.cc
src/ia32/lithium-codegen-ia32.cc
src/ia32/lithium-ia32.cc
src/macros.py
src/mips/full-codegen-mips.cc
src/mips/lithium-codegen-mips.cc
src/mips/lithium-mips.cc
src/mips64/full-codegen-mips64.cc
src/mips64/lithium-codegen-mips64.cc
src/mips64/lithium-mips64.cc
src/runtime/runtime-date.cc
src/runtime/runtime.h
src/x64/full-codegen-x64.cc
src/x64/lithium-codegen-x64.cc
src/x64/lithium-x64.cc