Simple toplevel code generator support for short-circuited boolean OR
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 23 Oct 2009 10:42:14 +0000 (10:42 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 23 Oct 2009 10:42:14 +0000 (10:42 +0000)
commite82a07c0bd891487f5fa94fba2774ebddb3fddfe
tree5bc4ce31dd002982a06190daa9c41303839e1e45
parentef95097334219bcef25458f0488e98a638cbb26c
Simple toplevel code generator support for short-circuited boolean OR
in a non-test (ie, value or effect) context.  (It is implicitly not in
a test context because the code generator does not support expressions
in a test context yet.)

Compilation is essentially the same as in the optimized code
generator.  The expression (e0 || e1) is compiled as if it were
(let (temp = e0) temp ? temp : e1).

On ia32 and x64 a single shared ToBoolean stub is used to convert a
value to a flag.  The inlined checks assumed by the stub are reordered
to compare to undefined (the common case in toplevel code?) first.  On
ARM a call to the runtime is used.  In the interest of code size no
checks are yet inlined on ARM.

Review URL: http://codereview.chromium.org/334006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/arm/fast-codegen-arm.cc
src/compiler.cc
src/fast-codegen.cc
src/ia32/codegen-ia32.cc
src/ia32/codegen-ia32.h
src/ia32/fast-codegen-ia32.cc
src/x64/codegen-x64.cc
src/x64/codegen-x64.h
src/x64/fast-codegen-x64.cc