Chromium Code Reviews| Index: src/compiler/bytecode-graph-builder.cc |
| diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
| index 064b4b85585e55ef1dea765ad6841e876c3a7d4d..4914b3bbc7df7db7a06d58bf4e01d64b45c20476 100644 |
| --- a/src/compiler/bytecode-graph-builder.cc |
| +++ b/src/compiler/bytecode-graph-builder.cc |
| @@ -460,89 +460,144 @@ void BytecodeGraphBuilder::VisitLoadICStrict( |
| } |
| -void BytecodeGraphBuilder::VisitKeyedLoadICSloppy( |
| +void BytecodeGraphBuilder::VisitLoadICSloppyWide( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_sloppy(language_mode())); |
| + BuildNamedLoad(iterator); |
| } |
| -void BytecodeGraphBuilder::VisitKeyedLoadICStrict( |
| +void BytecodeGraphBuilder::VisitLoadICStrictWide( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_strict(language_mode())); |
| + BuildNamedLoad(iterator); |
| } |
| -void BytecodeGraphBuilder::VisitLoadICSloppyWide( |
| +void BytecodeGraphBuilder::BuildKeyedLoad( |
| + const interpreter::BytecodeArrayIterator& iterator) { |
| + Node* key = environment()->LookupAccumulator(); |
| + Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
| + VectorSlotPair feedback = CreateVectorSlotPair(iterator.GetIndexOperand(1)); |
| + |
| + const Operator* op = javascript()->LoadProperty(language_mode(), feedback); |
| + Node* node = NewNode(op, object, key, BuildLoadFeedbackVector()); |
| + AddEmptyFrameStateInputs(node); |
| + environment()->BindAccumulator(node); |
| +} |
| + |
| + |
| +void BytecodeGraphBuilder::VisitKeyedLoadICSloppy( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| DCHECK(is_sloppy(language_mode())); |
| - BuildNamedLoad(iterator); |
| + BuildKeyedLoad(iterator); |
| } |
| -void BytecodeGraphBuilder::VisitLoadICStrictWide( |
| +void BytecodeGraphBuilder::VisitKeyedLoadICStrict( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| DCHECK(is_strict(language_mode())); |
| - BuildNamedLoad(iterator); |
| + BuildKeyedLoad(iterator); |
| } |
| void BytecodeGraphBuilder::VisitKeyedLoadICSloppyWide( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_sloppy(language_mode())); |
| + BuildKeyedLoad(iterator); |
| } |
| void BytecodeGraphBuilder::VisitKeyedLoadICStrictWide( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_strict(language_mode())); |
| + BuildKeyedLoad(iterator); |
| +} |
| + |
| + |
| +void BytecodeGraphBuilder::BuildNamedStore( |
| + const interpreter::BytecodeArrayIterator& iterator) { |
| + Node* value = environment()->LookupAccumulator(); |
| + Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
| + Handle<Name> name = |
| + Handle<Name>::cast(iterator.GetConstantForIndexOperand(1)); |
| + VectorSlotPair feedback = CreateVectorSlotPair(iterator.GetIndexOperand(2)); |
| + |
| + const Operator* op = |
| + javascript()->StoreNamed(language_mode(), name, feedback); |
| + Node* node = NewNode(op, object, value, BuildLoadFeedbackVector()); |
| + AddEmptyFrameStateInputs(node); |
| + environment()->BindAccumulator(node); |
|
Michael Starzinger
2015/11/19 11:59:38
The JSStoreNamed operator doesn't produce value ou
mythria
2015/11/19 12:41:24
Done.
mythria
2015/11/19 12:41:24
Thanks for pointing this. Stores, do not produce a
Michael Starzinger
2015/11/19 12:44:05
I would vote for being explicit about the accumula
mythria
2015/11/19 13:24:06
I Made it explicit.
Done.
|
| } |
| void BytecodeGraphBuilder::VisitStoreICSloppy( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_sloppy(language_mode())); |
| + BuildNamedStore(iterator); |
| } |
| void BytecodeGraphBuilder::VisitStoreICStrict( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_strict(language_mode())); |
| + BuildNamedStore(iterator); |
| } |
| -void BytecodeGraphBuilder::VisitKeyedStoreICSloppy( |
| +void BytecodeGraphBuilder::VisitStoreICSloppyWide( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_sloppy(language_mode())); |
| + BuildNamedStore(iterator); |
| } |
| -void BytecodeGraphBuilder::VisitKeyedStoreICStrict( |
| +void BytecodeGraphBuilder::VisitStoreICStrictWide( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_strict(language_mode())); |
| + BuildNamedStore(iterator); |
| } |
| -void BytecodeGraphBuilder::VisitStoreICSloppyWide( |
| +void BytecodeGraphBuilder::BuildKeyedStore( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + Node* value = environment()->LookupAccumulator(); |
| + Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
| + Node* key = environment()->LookupRegister(iterator.GetRegisterOperand(1)); |
| + VectorSlotPair feedback = CreateVectorSlotPair(iterator.GetIndexOperand(2)); |
| + |
| + const Operator* op = javascript()->StoreProperty(language_mode(), feedback); |
| + Node* node = NewNode(op, object, key, value, BuildLoadFeedbackVector()); |
| + AddEmptyFrameStateInputs(node); |
| + environment()->BindAccumulator(node); |
|
Michael Starzinger
2015/11/19 11:59:38
Likewise for s/node/value/ here?
mythria
2015/11/19 12:41:24
Done.
|
| } |
| -void BytecodeGraphBuilder::VisitStoreICStrictWide( |
| +void BytecodeGraphBuilder::VisitKeyedStoreICSloppy( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_sloppy(language_mode())); |
| + BuildKeyedStore(iterator); |
| +} |
| + |
| + |
| +void BytecodeGraphBuilder::VisitKeyedStoreICStrict( |
| + const interpreter::BytecodeArrayIterator& iterator) { |
| + DCHECK(is_strict(language_mode())); |
| + BuildKeyedStore(iterator); |
| } |
| void BytecodeGraphBuilder::VisitKeyedStoreICSloppyWide( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_sloppy(language_mode())); |
| + BuildKeyedStore(iterator); |
| } |
| void BytecodeGraphBuilder::VisitKeyedStoreICStrictWide( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + DCHECK(is_strict(language_mode())); |
| + BuildKeyedStore(iterator); |
| } |