Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/hydrogen.cc

Issue 892383003: emit premonomorphic ics for loads/stores in optimized code (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6509 matching lines...) Expand 10 before | Expand all | Expand 10 after
6520 } 6520 }
6521 HInstruction* instr = 6521 HInstruction* instr =
6522 Add<HStoreGlobalCell>(value, cell, it.property_details()); 6522 Add<HStoreGlobalCell>(value, cell, it.property_details());
6523 if (instr->HasObservableSideEffects()) { 6523 if (instr->HasObservableSideEffects()) {
6524 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); 6524 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
6525 } 6525 }
6526 } else { 6526 } else {
6527 HValue* global_object = Add<HLoadNamedField>( 6527 HValue* global_object = Add<HLoadNamedField>(
6528 context(), nullptr, 6528 context(), nullptr,
6529 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); 6529 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
6530 HStoreNamedGeneric* instr = Add<HStoreNamedGeneric>( 6530 HStoreNamedGeneric* instr =
6531 global_object, var->name(), value, function_language_mode()); 6531 Add<HStoreNamedGeneric>(global_object, var->name(), value,
6532 function_language_mode(), PREMONOMORPHIC);
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 }
6536 } 6537 }
6537 6538
6538 6539
6539 void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { 6540 void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
6540 Expression* target = expr->target(); 6541 Expression* target = expr->target();
6541 VariableProxy* proxy = target->AsVariableProxy(); 6542 VariableProxy* proxy = target->AsVariableProxy();
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
6819 if (c_string->HasStringValue()) { 6820 if (c_string->HasStringValue()) {
6820 return Add<HConstant>(c_string->StringValue()->length()); 6821 return Add<HConstant>(c_string->StringValue()->length());
6821 } 6822 }
6822 } 6823 }
6823 return Add<HLoadNamedField>(string, nullptr, 6824 return Add<HLoadNamedField>(string, nullptr,
6824 HObjectAccess::ForStringLength()); 6825 HObjectAccess::ForStringLength());
6825 } 6826 }
6826 6827
6827 6828
6828 HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( 6829 HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
6829 PropertyAccessType access_type, 6830 PropertyAccessType access_type, Expression* expr, HValue* object,
6830 Expression* expr, 6831 Handle<String> name, HValue* value, bool is_uninitialized) {
6831 HValue* object,
6832 Handle<String> name,
6833 HValue* value,
6834 bool is_uninitialized) {
6835 if (is_uninitialized) { 6832 if (is_uninitialized) {
6836 Add<HDeoptimize>( 6833 Add<HDeoptimize>(
6837 Deoptimizer::kInsufficientTypeFeedbackForGenericNamedAccess, 6834 Deoptimizer::kInsufficientTypeFeedbackForGenericNamedAccess,
6838 Deoptimizer::SOFT); 6835 Deoptimizer::SOFT);
6839 } 6836 }
6840 if (access_type == LOAD) { 6837 if (access_type == LOAD) {
6841 HLoadNamedGeneric* result = New<HLoadNamedGeneric>(object, name); 6838 HLoadNamedGeneric* result =
6839 New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC);
6842 if (FLAG_vector_ics) { 6840 if (FLAG_vector_ics) {
6843 Handle<SharedFunctionInfo> current_shared = 6841 Handle<SharedFunctionInfo> current_shared =
6844 function_state()->compilation_info()->shared_info(); 6842 function_state()->compilation_info()->shared_info();
6845 Handle<TypeFeedbackVector> vector = 6843 Handle<TypeFeedbackVector> vector =
6846 handle(current_shared->feedback_vector(), isolate()); 6844 handle(current_shared->feedback_vector(), isolate());
6847 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); 6845 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot();
6848 result->SetVectorAndSlot(vector, slot); 6846 result->SetVectorAndSlot(vector, slot);
6849 } 6847 }
6850 return result; 6848 return result;
6851 } else { 6849 } else {
6852 return New<HStoreNamedGeneric>(object, name, value, 6850 return New<HStoreNamedGeneric>(object, name, value,
6853 function_language_mode()); 6851 function_language_mode(), PREMONOMORPHIC);
6854 } 6852 }
6855 } 6853 }
6856 6854
6857 6855
6858 6856
6859 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( 6857 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric(
6860 PropertyAccessType access_type, 6858 PropertyAccessType access_type,
6861 Expression* expr, 6859 Expression* expr,
6862 HValue* object, 6860 HValue* object,
6863 HValue* key, 6861 HValue* key,
(...skipping 6575 matching lines...) Expand 10 before | Expand all | Expand 10 after
13439 if (ShouldProduceTraceOutput()) { 13437 if (ShouldProduceTraceOutput()) {
13440 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13438 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13441 } 13439 }
13442 13440
13443 #ifdef DEBUG 13441 #ifdef DEBUG
13444 graph_->Verify(false); // No full verify. 13442 graph_->Verify(false); // No full verify.
13445 #endif 13443 #endif
13446 } 13444 }
13447 13445
13448 } } // namespace v8::internal 13446 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698