| 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 6568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6579 HInstruction* instr = | 6579 HInstruction* instr = |
| 6580 Add<HStoreGlobalCell>(value, cell, it.property_details()); | 6580 Add<HStoreGlobalCell>(value, cell, it.property_details()); |
| 6581 if (instr->HasObservableSideEffects()) { | 6581 if (instr->HasObservableSideEffects()) { |
| 6582 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); | 6582 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); |
| 6583 } | 6583 } |
| 6584 } else { | 6584 } else { |
| 6585 HValue* global_object = Add<HLoadNamedField>( | 6585 HValue* global_object = Add<HLoadNamedField>( |
| 6586 context(), nullptr, | 6586 context(), nullptr, |
| 6587 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); | 6587 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); |
| 6588 HStoreNamedGeneric* instr = Add<HStoreNamedGeneric>( | 6588 HStoreNamedGeneric* instr = Add<HStoreNamedGeneric>( |
| 6589 global_object, var->name(), value, function_language_mode()); | 6589 global_object, var->name(), value, function_language_mode(), false); |
| 6590 USE(instr); | 6590 USE(instr); |
| 6591 DCHECK(instr->HasObservableSideEffects()); | 6591 DCHECK(instr->HasObservableSideEffects()); |
| 6592 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); | 6592 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); |
| 6593 } | 6593 } |
| 6594 } | 6594 } |
| 6595 | 6595 |
| 6596 | 6596 |
| 6597 void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { | 6597 void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { |
| 6598 Expression* target = expr->target(); | 6598 Expression* target = expr->target(); |
| 6599 VariableProxy* proxy = target->AsVariableProxy(); | 6599 VariableProxy* proxy = target->AsVariableProxy(); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6877 if (c_string->HasStringValue()) { | 6877 if (c_string->HasStringValue()) { |
| 6878 return Add<HConstant>(c_string->StringValue()->length()); | 6878 return Add<HConstant>(c_string->StringValue()->length()); |
| 6879 } | 6879 } |
| 6880 } | 6880 } |
| 6881 return Add<HLoadNamedField>(string, nullptr, | 6881 return Add<HLoadNamedField>(string, nullptr, |
| 6882 HObjectAccess::ForStringLength()); | 6882 HObjectAccess::ForStringLength()); |
| 6883 } | 6883 } |
| 6884 | 6884 |
| 6885 | 6885 |
| 6886 HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( | 6886 HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( |
| 6887 PropertyAccessType access_type, | 6887 PropertyAccessType access_type, Expression* expr, HValue* object, |
| 6888 Expression* expr, | 6888 Handle<String> name, HValue* value, bool is_uninitialized) { |
| 6889 HValue* object, | |
| 6890 Handle<String> name, | |
| 6891 HValue* value, | |
| 6892 bool is_uninitialized) { | |
| 6893 if (is_uninitialized) { | 6889 if (is_uninitialized) { |
| 6894 Add<HDeoptimize>( | 6890 Add<HDeoptimize>( |
| 6895 Deoptimizer::kInsufficientTypeFeedbackForGenericNamedAccess, | 6891 Deoptimizer::kInsufficientTypeFeedbackForGenericNamedAccess, |
| 6896 Deoptimizer::SOFT); | 6892 Deoptimizer::SOFT); |
| 6897 } | 6893 } |
| 6898 if (access_type == LOAD) { | 6894 if (access_type == LOAD) { |
| 6899 HLoadNamedGeneric* result = New<HLoadNamedGeneric>(object, name); | 6895 HLoadNamedGeneric* result = New<HLoadNamedGeneric>(object, name, true); |
| 6900 if (FLAG_vector_ics) { | 6896 if (FLAG_vector_ics) { |
| 6901 Handle<SharedFunctionInfo> current_shared = | 6897 Handle<SharedFunctionInfo> current_shared = |
| 6902 function_state()->compilation_info()->shared_info(); | 6898 function_state()->compilation_info()->shared_info(); |
| 6903 Handle<TypeFeedbackVector> vector = | 6899 Handle<TypeFeedbackVector> vector = |
| 6904 handle(current_shared->feedback_vector(), isolate()); | 6900 handle(current_shared->feedback_vector(), isolate()); |
| 6905 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); | 6901 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
| 6906 result->SetVectorAndSlot(vector, slot); | 6902 result->SetVectorAndSlot(vector, slot); |
| 6907 } | 6903 } |
| 6908 return result; | 6904 return result; |
| 6909 } else { | 6905 } else { |
| 6910 return New<HStoreNamedGeneric>(object, name, value, | 6906 return New<HStoreNamedGeneric>(object, name, value, |
| 6911 function_language_mode()); | 6907 function_language_mode(), true); |
| 6912 } | 6908 } |
| 6913 } | 6909 } |
| 6914 | 6910 |
| 6915 | 6911 |
| 6916 | 6912 |
| 6917 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( | 6913 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( |
| 6918 PropertyAccessType access_type, | 6914 PropertyAccessType access_type, |
| 6919 Expression* expr, | 6915 Expression* expr, |
| 6920 HValue* object, | 6916 HValue* object, |
| 6921 HValue* key, | 6917 HValue* key, |
| (...skipping 6566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13488 if (ShouldProduceTraceOutput()) { | 13484 if (ShouldProduceTraceOutput()) { |
| 13489 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13485 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13490 } | 13486 } |
| 13491 | 13487 |
| 13492 #ifdef DEBUG | 13488 #ifdef DEBUG |
| 13493 graph_->Verify(false); // No full verify. | 13489 graph_->Verify(false); // No full verify. |
| 13494 #endif | 13490 #endif |
| 13495 } | 13491 } |
| 13496 | 13492 |
| 13497 } } // namespace v8::internal | 13493 } } // namespace v8::internal |
| OLD | NEW |