[es6] Introduce a dedicated JSIteratorResult type.
authorbmeurer <bmeurer@chromium.org>
Thu, 3 Sep 2015 12:16:15 +0000 (05:16 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 3 Sep 2015 12:16:25 +0000 (12:16 +0000)
commit72bc4b5c8a5c4279bcb8b340edbc8aa1c46d75a1
treebf322b5f6f9cd4f2c3b16334e6af884386d0c3f5
parentc8dbd2c477c47a34593a0e7deee55915425b4ac2
[es6] Introduce a dedicated JSIteratorResult type.

Use a single JSIteratorResult type for all implementation provided
iterator results (i.e. the String, Array and collection iterators,
and also for generators).  This removes one source of unnecessary
polymorphism in for-of loops.  It is accomplished by a new intrinsic
%_CreateIterResultObject() that should be used to create iterator
result objects from JavaScript builtins (there's a matching factory
method for C++ code).

Also restructure the %StringIteratorPrototype%.next() and
%ArrayIteratorPrototype%.next() functions to be a bit more friendly
to optimizing compilers.

R=ishell@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30557}
24 files changed:
src/array-iterator.js
src/bootstrapper.cc
src/collection-iterator.js
src/contexts.h
src/factory.cc
src/factory.h
src/full-codegen/arm/full-codegen-arm.cc
src/full-codegen/arm64/full-codegen-arm64.cc
src/full-codegen/full-codegen.h
src/full-codegen/ia32/full-codegen-ia32.cc
src/full-codegen/mips/full-codegen-mips.cc
src/full-codegen/mips64/full-codegen-mips64.cc
src/full-codegen/x64/full-codegen-x64.cc
src/heap/objects-visiting.cc
src/hydrogen.cc
src/hydrogen.h
src/objects-debug.cc
src/objects-inl.h
src/objects-printer.cc
src/objects.h
src/runtime/runtime-object.cc
src/runtime/runtime.h
src/string-iterator.js
src/x64/macro-assembler-x64.h