Codegen: array access (part 1)
commit08aa651f41715bb8c9b56db38f72b233d43537a8
authorAndrew Kennedy <akenn@fb.com>
Wed, 1 Mar 2017 19:28:51 +0000 (1 11:28 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 1 Mar 2017 19:32:07 +0000 (1 11:32 -0800)
tree3da65d4c80917b6d9163f15ee3cb1c94447b538f
parentbd18f8718f77408f7b188d88a6bbde746aa8500d
Codegen: array access (part 1)

Summary:
Generate code for r-value expressions such as `$x[3]` or `$x[$ix+1]`. Variations in bytecode required for constant indices (integer and string), local variable indices, and general expression indices.
Also variation when expression is an argument to a function.

If array expression is a general expression (e.g. `(foo($x))[3]`) we don't quite get things right yet. Also, the assembler syntax we generate includes local names embedded in the instruction
(e.g. `EL:$a`) and this is not yet supported by the the HHVM assembler.

Reviewed By: hubyrod, oulgen

Differential Revision: D4630807

fbshipit-source-id: 2919fc4e890cdaba2a497efa6e5ccfe36db59bb6
hphp/hack/src/hhbc/hhbc_ast.ml
hphp/hack/src/hhbc/hhbc_from_nast.ml
hphp/hack/src/hhbc/hhbc_hhas.ml