OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 352 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
353 ReplaceWithStubCall(node, callable, flags); | 353 ReplaceWithStubCall(node, callable, flags); |
354 } | 354 } |
355 } | 355 } |
356 | 356 |
357 | 357 |
358 void JSGenericLowering::LowerJSStoreProperty(Node* node) { | 358 void JSGenericLowering::LowerJSStoreProperty(Node* node) { |
359 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 359 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
360 const StorePropertyParameters& p = StorePropertyParametersOf(node->op()); | 360 const StorePropertyParameters& p = StorePropertyParametersOf(node->op()); |
361 LanguageMode language_mode = OpParameter<LanguageMode>(node); | 361 LanguageMode language_mode = OpParameter<LanguageMode>(node); |
362 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( | 362 InlineCacheState state = FLAG_vector_stores && p.feedback().index() == -1 |
Michael Starzinger
2015/07/24 11:51:30
Can we restructure this a little to be more readab
mvstanton
2015/07/24 12:24:58
Most wise, thanks!
| |
363 isolate(), language_mode, UNINITIALIZED); | 363 ? MEGAMORPHIC |
364 : UNINITIALIZED; | |
365 Callable callable = | |
366 CodeFactory::KeyedStoreICInOptimizedCode(isolate(), language_mode, state); | |
364 if (FLAG_vector_stores) { | 367 if (FLAG_vector_stores) { |
365 DCHECK(p.feedback().index() != -1); | 368 if (state == MEGAMORPHIC) { |
366 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); | 369 // We have a special case where we do keyed stores but don't have a type |
370 // feedback vector slot allocated to support it. In this case, install | |
371 // the megamorphic keyed store stub which needs neither vector nor slot. | |
372 node->RemoveInput(3); | |
373 } else { | |
374 DCHECK(p.feedback().index() != -1); | |
375 node->InsertInput(zone(), 3, | |
376 jsgraph()->SmiConstant(p.feedback().index())); | |
377 } | |
367 } else { | 378 } else { |
368 node->RemoveInput(3); | 379 node->RemoveInput(3); |
369 } | 380 } |
370 ReplaceWithStubCall(node, callable, | 381 ReplaceWithStubCall(node, callable, |
371 CallDescriptor::kPatchableCallSite | flags); | 382 CallDescriptor::kPatchableCallSite | flags); |
372 } | 383 } |
373 | 384 |
374 | 385 |
375 void JSGenericLowering::LowerJSStoreNamed(Node* node) { | 386 void JSGenericLowering::LowerJSStoreNamed(Node* node) { |
376 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 387 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
841 } | 852 } |
842 | 853 |
843 | 854 |
844 MachineOperatorBuilder* JSGenericLowering::machine() const { | 855 MachineOperatorBuilder* JSGenericLowering::machine() const { |
845 return jsgraph()->machine(); | 856 return jsgraph()->machine(); |
846 } | 857 } |
847 | 858 |
848 } // namespace compiler | 859 } // namespace compiler |
849 } // namespace internal | 860 } // namespace internal |
850 } // namespace v8 | 861 } // namespace v8 |
OLD | NEW |