Skip to content

Commit

Permalink
Add support for vecs to be statically initialized if all values in it…
Browse files Browse the repository at this point in the history
… can be statically initialized

Summary: Add support for vecs to be statically initialized if all values in it can be statically initialized

Reviewed By: vladima

Differential Revision: D5904174

fbshipit-source-id: c22de2c0f507428fe095b6ee7d11f530d92b7014
  • Loading branch information
oulgen authored and hhvm-bot committed Sep 26, 2017
1 parent 875c288 commit f93d23e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions hphp/hack/src/hhbc/instruction_sequence.ml
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ let rewrite_class_refs instrseq =
let name =
Hhbc_string_utils.Types.fix_casing @@ Hhbc_string_utils.strip_ns name in
begin match name with
| "vec" ->
List.for_all fields ~f:(function
| A.AFvalue e -> can_initialize_static_var e
| _ -> false)
| "keyset" ->
List.for_all fields ~f:(function
| A.AFvalue (_, (A.String _ | A.Int _)) -> true
Expand Down
2 changes: 0 additions & 2 deletions hphp/test/hhcodegen_failing_tests_slow
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ slow/collection_classes/815.php
slow/compilation/1238.php
slow/compilation/1247.php
slow/compilation/1316.php
slow/compilation/infinite-static-local.php
slow/compilation/switch-default-multiple.php
slow/concat/1573.php
slow/concat/1575.php
Expand Down Expand Up @@ -341,6 +340,5 @@ slow/vec/hh-only1.php
slow/vec/hh-only2.php
slow/xhp/attr-syntax-2.php
slow/xhp/attr-syntax-3.php
slow/xhp/deprecated_xhp_class_method.php
slow/yield/2167.php
slow/yield/2229.php

0 comments on commit f93d23e

Please sign in to comment.