Add new bytecode instructions for vec/dict/keyset
commit13affe76732d1cd0055f826fd86bf280111f5668
authorRick Lavoie <rlavoie@fb.com>
Tue, 16 Aug 2016 20:28:45 +0000 (16 13:28 -0700)
committerHhvm Bot <hhvm-bot-bot@fb.com>
Tue, 16 Aug 2016 20:49:00 +0000 (16 13:49 -0700)
treeb20c8f7c4b120aa96a04853169fd4871e46d8aef
parent6a7f834b8ba2ad067c7e85cdf22b4a7853545ce2
Add new bytecode instructions for vec/dict/keyset

Summary:
Add new bytecode instructions CastDict, CastVec, CastKeyset to cast to
a dict, vec, or keyset. Also add Dict, Vec, and Keyset to generate literal
dicts, vecs, or keysets. Array was previously overloaded to do this, but its
cleaner to have separate instructions to distinguish them. Note that AddElemC
can be used on dicts as well. Make sure the return type is inferred from the
input rather than assuming its always an array.

Reviewed By: paulbiss

Differential Revision: D3490107

fbshipit-source-id: 54288ef351cdb8a4b6967d205768bb2ee83de77e
21 files changed:
hphp/compiler/analysis/emitter.cpp
hphp/doc/bytecode.specification
hphp/hhbbc/dce.cpp
hphp/hhbbc/interp.cpp
hphp/hhbbc/optimize.cpp
hphp/hhbbc/type-system.cpp
hphp/runtime/base/builtin-functions.h
hphp/runtime/base/tv-helpers.cpp
hphp/runtime/base/tv-helpers.h
hphp/runtime/ext/array/ext_array.cpp
hphp/runtime/ext/array/ext_array.php
hphp/runtime/vm/bytecode.cpp
hphp/runtime/vm/bytecode.h
hphp/runtime/vm/hhbc.cpp
hphp/runtime/vm/hhbc.h
hphp/runtime/vm/jit/irgen-basic.cpp
hphp/runtime/vm/jit/irgen-interpone.cpp
hphp/runtime/vm/jit/irgen-types.cpp
hphp/runtime/vm/jit/region-tracelet.cpp
hphp/runtime/vm/jit/translator.cpp
hphp/runtime/vm/jit/translator.h