| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 6818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6829 } | 6829 } |
| 6830 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate()); | 6830 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate()); |
| 6831 | 6831 |
| 6832 HValue* key = Add<HConstant>(name); | 6832 HValue* key = Add<HConstant>(name); |
| 6833 HValue* vector_value = Add<HConstant>(vector); | 6833 HValue* vector_value = Add<HConstant>(vector); |
| 6834 HValue* slot_value = Add<HConstant>(vector->GetIndex(slot)); | 6834 HValue* slot_value = Add<HConstant>(vector->GetIndex(slot)); |
| 6835 | 6835 |
| 6836 if (access_type == LOAD) { | 6836 if (access_type == LOAD) { |
| 6837 HValue* values[] = {object, key, slot_value, vector_value}; | 6837 HValue* values[] = {object, key, slot_value, vector_value}; |
| 6838 if (!expr->AsProperty()->key()->IsPropertyName()) { | 6838 if (!expr->AsProperty()->key()->IsPropertyName()) { |
| 6839 DCHECK(vector->IsKeyedLoadIC(slot)); |
| 6839 // It's possible that a keyed load of a constant string was converted | 6840 // It's possible that a keyed load of a constant string was converted |
| 6840 // to a named load. Here, at the last minute, we need to make sure to | 6841 // to a named load. Here, at the last minute, we need to make sure to |
| 6841 // use a generic Keyed Load if we are using the type vector, because | 6842 // use a generic Keyed Load if we are using the type vector, because |
| 6842 // it has to share information with full code. | 6843 // it has to share information with full code. |
| 6843 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate()); | 6844 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate()); |
| 6844 HValue* stub = Add<HConstant>(callable.code()); | 6845 HValue* stub = Add<HConstant>(callable.code()); |
| 6845 HCallWithDescriptor* result = | 6846 HCallWithDescriptor* result = |
| 6846 New<HCallWithDescriptor>(Code::KEYED_LOAD_IC, stub, 0, | 6847 New<HCallWithDescriptor>(Code::KEYED_LOAD_IC, stub, 0, |
| 6847 callable.descriptor(), ArrayVector(values)); | 6848 callable.descriptor(), ArrayVector(values)); |
| 6848 return result; | 6849 return result; |
| 6849 } | 6850 } |
| 6851 DCHECK(vector->IsLoadIC(slot)); |
| 6850 Callable callable = CodeFactory::LoadICInOptimizedCode(isolate()); | 6852 Callable callable = CodeFactory::LoadICInOptimizedCode(isolate()); |
| 6851 HValue* stub = Add<HConstant>(callable.code()); | 6853 HValue* stub = Add<HConstant>(callable.code()); |
| 6852 HCallWithDescriptor* result = New<HCallWithDescriptor>( | 6854 HCallWithDescriptor* result = New<HCallWithDescriptor>( |
| 6853 Code::LOAD_IC, stub, 0, callable.descriptor(), ArrayVector(values)); | 6855 Code::LOAD_IC, stub, 0, callable.descriptor(), ArrayVector(values)); |
| 6854 return result; | 6856 return result; |
| 6855 | 6857 |
| 6856 } else { | 6858 } else { |
| 6857 HValue* values[] = {object, key, value, slot_value, vector_value}; | 6859 HValue* values[] = {object, key, value, slot_value, vector_value}; |
| 6858 if (vector->GetKind(slot) == FeedbackVectorSlotKind::KEYED_STORE_IC) { | 6860 if (vector->IsKeyedStoreIC(slot)) { |
| 6859 // It's possible that a keyed store of a constant string was converted | 6861 // It's possible that a keyed store of a constant string was converted |
| 6860 // to a named store. Here, at the last minute, we need to make sure to | 6862 // to a named store. Here, at the last minute, we need to make sure to |
| 6861 // use a generic Keyed Store if we are using the type vector, because | 6863 // use a generic Keyed Store if we are using the type vector, because |
| 6862 // it has to share information with full code. | 6864 // it has to share information with full code. |
| 6863 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( | 6865 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( |
| 6864 isolate(), function_language_mode()); | 6866 isolate(), function_language_mode()); |
| 6865 HValue* stub = Add<HConstant>(callable.code()); | 6867 HValue* stub = Add<HConstant>(callable.code()); |
| 6866 HCallWithDescriptor* result = | 6868 HCallWithDescriptor* result = |
| 6867 New<HCallWithDescriptor>(Code::KEYED_STORE_IC, stub, 0, | 6869 New<HCallWithDescriptor>(Code::KEYED_STORE_IC, stub, 0, |
| 6868 callable.descriptor(), ArrayVector(values)); | 6870 callable.descriptor(), ArrayVector(values)); |
| 6869 return result; | 6871 return result; |
| 6870 } | 6872 } |
| 6873 DCHECK(vector->IsStoreIC(slot)); |
| 6871 Callable callable = CodeFactory::StoreICInOptimizedCode( | 6874 Callable callable = CodeFactory::StoreICInOptimizedCode( |
| 6872 isolate(), function_language_mode()); | 6875 isolate(), function_language_mode()); |
| 6873 HValue* stub = Add<HConstant>(callable.code()); | 6876 HValue* stub = Add<HConstant>(callable.code()); |
| 6874 HCallWithDescriptor* result = New<HCallWithDescriptor>( | 6877 HCallWithDescriptor* result = New<HCallWithDescriptor>( |
| 6875 Code::STORE_IC, stub, 0, callable.descriptor(), ArrayVector(values)); | 6878 Code::STORE_IC, stub, 0, callable.descriptor(), ArrayVector(values)); |
| 6876 return result; | 6879 return result; |
| 6877 } | 6880 } |
| 6878 } | 6881 } |
| 6879 | 6882 |
| 6880 | 6883 |
| (...skipping 6141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13022 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13025 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13023 } | 13026 } |
| 13024 | 13027 |
| 13025 #ifdef DEBUG | 13028 #ifdef DEBUG |
| 13026 graph_->Verify(false); // No full verify. | 13029 graph_->Verify(false); // No full verify. |
| 13027 #endif | 13030 #endif |
| 13028 } | 13031 } |
| 13029 | 13032 |
| 13030 } // namespace internal | 13033 } // namespace internal |
| 13031 } // namespace v8 | 13034 } // namespace v8 |
| OLD | NEW |