Chromium Code Reviews| 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 6575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6586 } | 6586 } |
| 6587 HInstruction* instr = | 6587 HInstruction* instr = |
| 6588 Add<HStoreGlobalCell>(value, cell, it.property_details()); | 6588 Add<HStoreGlobalCell>(value, cell, it.property_details()); |
| 6589 if (instr->HasObservableSideEffects()) { | 6589 if (instr->HasObservableSideEffects()) { |
| 6590 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); | 6590 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); |
| 6591 } | 6591 } |
| 6592 } else { | 6592 } else { |
| 6593 HValue* global_object = Add<HLoadNamedField>( | 6593 HValue* global_object = Add<HLoadNamedField>( |
| 6594 context(), nullptr, | 6594 context(), nullptr, |
| 6595 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); | 6595 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); |
| 6596 HStoreNamedGeneric* instr = Add<HStoreNamedGeneric>( | 6596 HStoreNamedGeneric* instr = |
| 6597 global_object, var->name(), value, function_language_mode()); | 6597 Add<HStoreNamedGeneric>(global_object, var->name(), value, |
| 6598 function_language_mode(), UNINITIALIZED); | |
|
Toon Verwaest
2015/02/09 14:27:59
PREMONOMORPHIC
| |
| 6598 USE(instr); | 6599 USE(instr); |
| 6599 DCHECK(instr->HasObservableSideEffects()); | 6600 DCHECK(instr->HasObservableSideEffects()); |
| 6600 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); | 6601 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); |
| 6601 } | 6602 } |
| 6602 } | 6603 } |
| 6603 | 6604 |
| 6604 | 6605 |
| 6605 void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { | 6606 void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { |
| 6606 Expression* target = expr->target(); | 6607 Expression* target = expr->target(); |
| 6607 VariableProxy* proxy = target->AsVariableProxy(); | 6608 VariableProxy* proxy = target->AsVariableProxy(); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6885 if (c_string->HasStringValue()) { | 6886 if (c_string->HasStringValue()) { |
| 6886 return Add<HConstant>(c_string->StringValue()->length()); | 6887 return Add<HConstant>(c_string->StringValue()->length()); |
| 6887 } | 6888 } |
| 6888 } | 6889 } |
| 6889 return Add<HLoadNamedField>(string, nullptr, | 6890 return Add<HLoadNamedField>(string, nullptr, |
| 6890 HObjectAccess::ForStringLength()); | 6891 HObjectAccess::ForStringLength()); |
| 6891 } | 6892 } |
| 6892 | 6893 |
| 6893 | 6894 |
| 6894 HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( | 6895 HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( |
| 6895 PropertyAccessType access_type, | 6896 PropertyAccessType access_type, Expression* expr, HValue* object, |
| 6896 Expression* expr, | 6897 Handle<String> name, HValue* value, bool is_uninitialized) { |
| 6897 HValue* object, | |
| 6898 Handle<String> name, | |
| 6899 HValue* value, | |
| 6900 bool is_uninitialized) { | |
| 6901 if (is_uninitialized) { | 6898 if (is_uninitialized) { |
| 6902 Add<HDeoptimize>( | 6899 Add<HDeoptimize>( |
| 6903 Deoptimizer::kInsufficientTypeFeedbackForGenericNamedAccess, | 6900 Deoptimizer::kInsufficientTypeFeedbackForGenericNamedAccess, |
| 6904 Deoptimizer::SOFT); | 6901 Deoptimizer::SOFT); |
| 6905 } | 6902 } |
| 6906 if (access_type == LOAD) { | 6903 if (access_type == LOAD) { |
| 6907 HLoadNamedGeneric* result = New<HLoadNamedGeneric>(object, name); | 6904 HLoadNamedGeneric* result = |
| 6905 New<HLoadNamedGeneric>(object, name, MEGAMORPHIC); | |
| 6908 if (FLAG_vector_ics) { | 6906 if (FLAG_vector_ics) { |
| 6909 Handle<SharedFunctionInfo> current_shared = | 6907 Handle<SharedFunctionInfo> current_shared = |
| 6910 function_state()->compilation_info()->shared_info(); | 6908 function_state()->compilation_info()->shared_info(); |
| 6911 Handle<TypeFeedbackVector> vector = | 6909 Handle<TypeFeedbackVector> vector = |
| 6912 handle(current_shared->feedback_vector(), isolate()); | 6910 handle(current_shared->feedback_vector(), isolate()); |
| 6913 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); | 6911 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
| 6914 result->SetVectorAndSlot(vector, slot); | 6912 result->SetVectorAndSlot(vector, slot); |
| 6915 } | 6913 } |
| 6916 return result; | 6914 return result; |
| 6917 } else { | 6915 } else { |
| 6918 return New<HStoreNamedGeneric>(object, name, value, | 6916 return New<HStoreNamedGeneric>(object, name, value, |
| 6919 function_language_mode()); | 6917 function_language_mode(), MEGAMORPHIC); |
| 6920 } | 6918 } |
| 6921 } | 6919 } |
| 6922 | 6920 |
| 6923 | 6921 |
| 6924 | 6922 |
| 6925 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( | 6923 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( |
| 6926 PropertyAccessType access_type, | 6924 PropertyAccessType access_type, |
| 6927 Expression* expr, | 6925 Expression* expr, |
| 6928 HValue* object, | 6926 HValue* object, |
| 6929 HValue* key, | 6927 HValue* key, |
| (...skipping 6566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13496 if (ShouldProduceTraceOutput()) { | 13494 if (ShouldProduceTraceOutput()) { |
| 13497 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13495 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13498 } | 13496 } |
| 13499 | 13497 |
| 13500 #ifdef DEBUG | 13498 #ifdef DEBUG |
| 13501 graph_->Verify(false); // No full verify. | 13499 graph_->Verify(false); // No full verify. |
| 13502 #endif | 13500 #endif |
| 13503 } | 13501 } |
| 13504 | 13502 |
| 13505 } } // namespace v8::internal | 13503 } } // namespace v8::internal |
| OLD | NEW |