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 39c0397181346f1ccba477059b9905a5a420c99d..5fff5a44e500cd0c7ada887d43f9d823973ab648 100644 |
| --- a/src/compiler/bytecode-graph-builder.cc |
| +++ b/src/compiler/bytecode-graph-builder.cc |
| @@ -886,6 +886,33 @@ void BytecodeGraphBuilder::VisitLdaLookupSlotInsideTypeof() { |
| BuildLdaLookupSlot(TypeofMode::INSIDE_TYPEOF); |
| } |
| +void BytecodeGraphBuilder::BuildLdaLookupContextSlot(TypeofMode typeof_mode) { |
| + // TODO(leszeks): Build the fast path here |
|
rmcilroy
2016/09/16 08:56:55
fullstop after comments (throughout cl)
Leszek Swirski
2016/09/16 10:46:54
Done.
|
| + |
| + // Slow path, do a runtime load lookup |
| + { |
| + FrameStateBeforeAndAfter states(this); |
| + |
| + Node* name = |
| + jsgraph()->Constant(bytecode_iterator().GetConstantForIndexOperand(0)); |
| + |
| + const Operator* op = |
| + javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF |
| + ? Runtime::kLoadLookupSlot |
| + : Runtime::kLoadLookupSlotInsideTypeof); |
| + Node* value = NewNode(op, name); |
| + environment()->BindAccumulator(value, &states); |
| + } |
| +} |
| + |
| +void BytecodeGraphBuilder::VisitLdaLookupContextSlot() { |
| + BuildLdaLookupContextSlot(TypeofMode::NOT_INSIDE_TYPEOF); |
| +} |
| + |
| +void BytecodeGraphBuilder::VisitLdaLookupContextSlotInsideTypeof() { |
| + BuildLdaLookupContextSlot(TypeofMode::INSIDE_TYPEOF); |
| +} |
| + |
| void BytecodeGraphBuilder::BuildStaLookupSlot(LanguageMode language_mode) { |
| FrameStateBeforeAndAfter states(this); |
| Node* value = environment()->LookupAccumulator(); |