[Interpreter] Add support for loading globals in the interpreter.
authorrmcilroy <rmcilroy@chromium.org>
Thu, 24 Sep 2015 11:48:22 +0000 (04:48 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 24 Sep 2015 11:48:37 +0000 (11:48 +0000)
commit8087c49dc763558368ea15f69d5f6247c287515f
treed683080fe7f82157f1dd8bddfedfd30757d174fa
parent809f6b15be82e3b85425b5d9a45fe981d487bf43
[Interpreter] Add support for loading globals in the interpreter.

Adds LdaGlobal bytecode and augments BytecodeGenerator to load globals for
global variables and function calls.

Modified TestBytecodeGenerator to add the ability to specify that a bytecode
operand has an unknown value (used so we don't need to figure out the slot
index of a global). Also added a helper which checks equality of BytecodeArray
with the expected snipptets.

Modified TestInterpreter to allow it to take snippets of JS and have the
BytecodeGenerator generate the bytecode rather than having to build a
BytecodeArray manually. This is used to enable the global tests.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30910}
14 files changed:
src/compiler/bytecode-graph-builder.cc
src/compiler/interpreter-assembler.cc
src/compiler/interpreter-assembler.h
src/interpreter/bytecode-array-builder.cc
src/interpreter/bytecode-array-builder.h
src/interpreter/bytecode-array-iterator.cc
src/interpreter/bytecode-array-iterator.h
src/interpreter/bytecode-generator.cc
src/interpreter/bytecode-generator.h
src/interpreter/bytecodes.h
src/interpreter/interpreter.cc
test/cctest/interpreter/test-bytecode-generator.cc
test/cctest/interpreter/test-interpreter.cc
test/unittests/interpreter/bytecode-array-builder-unittest.cc