[vm/bytecode] Revise PushStatic bytecode instruction

PushStatic instruction expects field object to be pushed onto the stack.
This is useless, as PushStatic also references field with its D operand.
This change replaces PushStatic instruction with LoadStatic which doesn't
take field object on the stack, so PushConstant/PushStatic pair is replaced
with a single LoadStatic instruction.

This change also enables constant propagation of values of injected CID
fields, which are not known at bytecode generation time.

Change-Id: Ifbdd3aea2aab338f6c9ec3e5728948c4d8541a4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112489
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
This commit is contained in:
Alexander Markov
2019-08-09 21:02:31 +00:00
committed by commit-bot@chromium.org
parent f74b0ccfb8
commit f255c0c8d3
9 changed files with 62 additions and 48 deletions
@@ -247,6 +247,8 @@ static intptr_t GetConstantPoolIndex(const KBCInstr* instr) {
case KernelBytecode::kPushConstant_Wide:
case KernelBytecode::kStoreStaticTOS:
case KernelBytecode::kStoreStaticTOS_Wide:
case KernelBytecode::kLoadStatic:
case KernelBytecode::kLoadStatic_Wide:
case KernelBytecode::kPushStatic:
case KernelBytecode::kPushStatic_Wide:
case KernelBytecode::kAllocate: