| 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 6505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6516 } | 6516 } |
| 6517 } else { | 6517 } else { |
| 6518 HValue* global_object = Add<HLoadNamedField>( | 6518 HValue* global_object = Add<HLoadNamedField>( |
| 6519 BuildGetNativeContext(), nullptr, | 6519 BuildGetNativeContext(), nullptr, |
| 6520 HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX)); | 6520 HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX)); |
| 6521 Handle<TypeFeedbackVector> vector = | 6521 Handle<TypeFeedbackVector> vector = |
| 6522 handle(current_feedback_vector(), isolate()); | 6522 handle(current_feedback_vector(), isolate()); |
| 6523 HValue* name = Add<HConstant>(var->name()); | 6523 HValue* name = Add<HConstant>(var->name()); |
| 6524 HValue* vector_value = Add<HConstant>(vector); | 6524 HValue* vector_value = Add<HConstant>(vector); |
| 6525 HValue* slot_value = Add<HConstant>(vector->GetIndex(slot)); | 6525 HValue* slot_value = Add<HConstant>(vector->GetIndex(slot)); |
| 6526 DCHECK_EQ(vector->GetLanguageMode(slot), function_language_mode()); |
| 6526 Callable callable = CodeFactory::StoreICInOptimizedCode( | 6527 Callable callable = CodeFactory::StoreICInOptimizedCode( |
| 6527 isolate(), function_language_mode()); | 6528 isolate(), function_language_mode()); |
| 6528 HValue* stub = Add<HConstant>(callable.code()); | 6529 HValue* stub = Add<HConstant>(callable.code()); |
| 6529 HValue* values[] = {global_object, name, value, slot_value, vector_value}; | 6530 HValue* values[] = {global_object, name, value, slot_value, vector_value}; |
| 6530 HCallWithDescriptor* instr = Add<HCallWithDescriptor>( | 6531 HCallWithDescriptor* instr = Add<HCallWithDescriptor>( |
| 6531 Code::STORE_IC, stub, 0, callable.descriptor(), ArrayVector(values)); | 6532 Code::STORE_IC, stub, 0, callable.descriptor(), ArrayVector(values)); |
| 6532 USE(instr); | 6533 USE(instr); |
| 6533 DCHECK(instr->HasObservableSideEffects()); | 6534 DCHECK(instr->HasObservableSideEffects()); |
| 6534 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); | 6535 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); |
| 6535 } | 6536 } |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6849 return result; | 6850 return result; |
| 6850 } | 6851 } |
| 6851 DCHECK(vector->IsLoadIC(slot)); | 6852 DCHECK(vector->IsLoadIC(slot)); |
| 6852 Callable callable = CodeFactory::LoadICInOptimizedCode(isolate()); | 6853 Callable callable = CodeFactory::LoadICInOptimizedCode(isolate()); |
| 6853 HValue* stub = Add<HConstant>(callable.code()); | 6854 HValue* stub = Add<HConstant>(callable.code()); |
| 6854 HCallWithDescriptor* result = New<HCallWithDescriptor>( | 6855 HCallWithDescriptor* result = New<HCallWithDescriptor>( |
| 6855 Code::LOAD_IC, stub, 0, callable.descriptor(), ArrayVector(values)); | 6856 Code::LOAD_IC, stub, 0, callable.descriptor(), ArrayVector(values)); |
| 6856 return result; | 6857 return result; |
| 6857 | 6858 |
| 6858 } else { | 6859 } else { |
| 6860 DCHECK_EQ(vector->GetLanguageMode(slot), function_language_mode()); |
| 6859 HValue* values[] = {object, key, value, slot_value, vector_value}; | 6861 HValue* values[] = {object, key, value, slot_value, vector_value}; |
| 6860 if (vector->IsKeyedStoreIC(slot)) { | 6862 if (vector->IsKeyedStoreIC(slot)) { |
| 6861 // It's possible that a keyed store of a constant string was converted | 6863 // It's possible that a keyed store of a constant string was converted |
| 6862 // to a named store. Here, at the last minute, we need to make sure to | 6864 // to a named store. Here, at the last minute, we need to make sure to |
| 6863 // use a generic Keyed Store if we are using the type vector, because | 6865 // use a generic Keyed Store if we are using the type vector, because |
| 6864 // it has to share information with full code. | 6866 // it has to share information with full code. |
| 6865 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( | 6867 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( |
| 6866 isolate(), function_language_mode()); | 6868 isolate(), function_language_mode()); |
| 6867 HValue* stub = Add<HConstant>(callable.code()); | 6869 HValue* stub = Add<HConstant>(callable.code()); |
| 6868 HCallWithDescriptor* result = | 6870 HCallWithDescriptor* result = |
| (...skipping 6156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13025 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13027 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13026 } | 13028 } |
| 13027 | 13029 |
| 13028 #ifdef DEBUG | 13030 #ifdef DEBUG |
| 13029 graph_->Verify(false); // No full verify. | 13031 graph_->Verify(false); // No full verify. |
| 13030 #endif | 13032 #endif |
| 13031 } | 13033 } |
| 13032 | 13034 |
| 13033 } // namespace internal | 13035 } // namespace internal |
| 13034 } // namespace v8 | 13036 } // namespace v8 |
| OLD | NEW |