[es6] Introduce spec compliant IsConstructor.
authorbmeurer <bmeurer@chromium.org>
Thu, 24 Sep 2015 04:00:25 +0000 (21:00 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 24 Sep 2015 04:00:40 +0000 (04:00 +0000)
commit8de4d9351df4cf66c8a128d561a6e331d196be54
treee55fc3c60f0e5ffd45d976b2ec4d26acba920d30
parent5ced12c154a88058ce5b83ccbaaefb0e8edd6ef2
[es6] Introduce spec compliant IsConstructor.

There was already a bit on the Map named "function with prototype",
which basically meant that the Map was a map for a JSFunction that could
be used as a constructor. Now this CL generalizes that bit to
IsConstructor, which says that whatever (Heap)Object you are looking at
can be used as a constructor (i.e. the bit is also set for bound
functions that can be used as constructors and proxies that have a
[[Construct]] internal method).

This way we have a single chokepoint for IsConstructor checking, which
allows us to get rid of the various ways in which we tried to guess
whether something could be used as a constructor or not.

Drive-by-fix: Renamed IsConstructor on FunctionKind to
IsClassConstructor to resolve the weird name clash, and the
IsClassConstructor name also matches the spec.

R=jarin@chromium.org, rossberg@chromium.org
BUG=v8:4430
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#30900}
26 files changed:
src/accessors.cc
src/api-natives.cc
src/arm/builtins-arm.cc
src/arm64/builtins-arm64.cc
src/bootstrapper.cc
src/builtins.h
src/contexts.h
src/factory.cc
src/globals.h
src/hydrogen.cc
src/ia32/builtins-ia32.cc
src/ic/ic.cc
src/mips/builtins-mips.cc
src/mips64/builtins-mips64.cc
src/objects-inl.h
src/objects.cc
src/objects.h
src/parser.cc
src/preparser.cc
src/preparser.h
src/runtime/runtime-classes.cc
src/runtime/runtime-function.cc
src/runtime/runtime-object.cc
src/scopes.cc
src/scopes.h
src/x64/builtins-x64.cc