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 6905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6916 bool is_uninitialized) { | 6916 bool is_uninitialized) { |
6917 if (is_uninitialized) { | 6917 if (is_uninitialized) { |
6918 Add<HDeoptimize>("Insufficient type feedback for generic named access", | 6918 Add<HDeoptimize>("Insufficient type feedback for generic named access", |
6919 Deoptimizer::SOFT); | 6919 Deoptimizer::SOFT); |
6920 } | 6920 } |
6921 if (access_type == LOAD) { | 6921 if (access_type == LOAD) { |
6922 HLoadNamedGeneric* result = New<HLoadNamedGeneric>(object, name); | 6922 HLoadNamedGeneric* result = New<HLoadNamedGeneric>(object, name); |
6923 if (FLAG_vector_ics) { | 6923 if (FLAG_vector_ics) { |
6924 Handle<SharedFunctionInfo> current_shared = | 6924 Handle<SharedFunctionInfo> current_shared = |
6925 function_state()->compilation_info()->shared_info(); | 6925 function_state()->compilation_info()->shared_info(); |
6926 result->SetVectorAndSlot( | 6926 Handle<TypeFeedbackVector> vector = |
6927 handle(current_shared->feedback_vector(), isolate()), | 6927 handle(current_shared->feedback_vector(), isolate()); |
6928 expr->AsProperty()->PropertyFeedbackSlot()); | 6928 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
| 6929 result->SetVectorAndSlot(vector, slot); |
6929 } | 6930 } |
6930 return result; | 6931 return result; |
6931 } else { | 6932 } else { |
6932 return New<HStoreNamedGeneric>(object, name, value, function_strict_mode()); | 6933 return New<HStoreNamedGeneric>(object, name, value, function_strict_mode()); |
6933 } | 6934 } |
6934 } | 6935 } |
6935 | 6936 |
6936 | 6937 |
6937 | 6938 |
6938 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( | 6939 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( |
6939 PropertyAccessType access_type, | 6940 PropertyAccessType access_type, |
6940 Expression* expr, | 6941 Expression* expr, |
6941 HValue* object, | 6942 HValue* object, |
6942 HValue* key, | 6943 HValue* key, |
6943 HValue* value) { | 6944 HValue* value) { |
6944 if (access_type == LOAD) { | 6945 if (access_type == LOAD) { |
6945 HLoadKeyedGeneric* result = New<HLoadKeyedGeneric>(object, key); | 6946 HLoadKeyedGeneric* result = New<HLoadKeyedGeneric>(object, key); |
6946 if (FLAG_vector_ics) { | 6947 if (FLAG_vector_ics) { |
6947 Handle<SharedFunctionInfo> current_shared = | 6948 Handle<SharedFunctionInfo> current_shared = |
6948 function_state()->compilation_info()->shared_info(); | 6949 function_state()->compilation_info()->shared_info(); |
6949 result->SetVectorAndSlot( | 6950 Handle<TypeFeedbackVector> vector = |
6950 handle(current_shared->feedback_vector(), isolate()), | 6951 handle(current_shared->feedback_vector(), isolate()); |
6951 expr->AsProperty()->PropertyFeedbackSlot()); | 6952 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
| 6953 result->SetVectorAndSlot(vector, slot); |
6952 } | 6954 } |
6953 return result; | 6955 return result; |
6954 } else { | 6956 } else { |
6955 return New<HStoreKeyedGeneric>(object, key, value, function_strict_mode()); | 6957 return New<HStoreKeyedGeneric>(object, key, value, function_strict_mode()); |
6956 } | 6958 } |
6957 } | 6959 } |
6958 | 6960 |
6959 | 6961 |
6960 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { | 6962 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { |
6961 // Loads from a "stock" fast holey double arrays can elide the hole check. | 6963 // Loads from a "stock" fast holey double arrays can elide the hole check. |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7217 FinishExitWithHardDeoptimization("Unknown map in polymorphic element access"); | 7219 FinishExitWithHardDeoptimization("Unknown map in polymorphic element access"); |
7218 set_current_block(join); | 7220 set_current_block(join); |
7219 return access_type == STORE ? val : Pop(); | 7221 return access_type == STORE ? val : Pop(); |
7220 } | 7222 } |
7221 | 7223 |
7222 | 7224 |
7223 HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess( | 7225 HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess( |
7224 HValue* obj, HValue* key, HValue* val, Expression* expr, BailoutId ast_id, | 7226 HValue* obj, HValue* key, HValue* val, Expression* expr, BailoutId ast_id, |
7225 BailoutId return_id, PropertyAccessType access_type, | 7227 BailoutId return_id, PropertyAccessType access_type, |
7226 bool* has_side_effects) { | 7228 bool* has_side_effects) { |
7227 if (key->ActualValue()->IsConstant()) { | 7229 // TODO(mvstanton): This optimization causes trouble for vector-based |
| 7230 // KeyedLoadICs, turn it off for now. |
| 7231 if (!FLAG_vector_ics && key->ActualValue()->IsConstant()) { |
7228 Handle<Object> constant = | 7232 Handle<Object> constant = |
7229 HConstant::cast(key->ActualValue())->handle(isolate()); | 7233 HConstant::cast(key->ActualValue())->handle(isolate()); |
7230 uint32_t array_index; | 7234 uint32_t array_index; |
7231 if (constant->IsString() && | 7235 if (constant->IsString() && |
7232 !Handle<String>::cast(constant)->AsArrayIndex(&array_index)) { | 7236 !Handle<String>::cast(constant)->AsArrayIndex(&array_index)) { |
7233 if (!constant->IsUniqueName()) { | 7237 if (!constant->IsUniqueName()) { |
7234 constant = isolate()->factory()->InternalizeString( | 7238 constant = isolate()->factory()->InternalizeString( |
7235 Handle<String>::cast(constant)); | 7239 Handle<String>::cast(constant)); |
7236 } | 7240 } |
7237 HInstruction* instr = | 7241 HInstruction* instr = |
(...skipping 5547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12785 if (ShouldProduceTraceOutput()) { | 12789 if (ShouldProduceTraceOutput()) { |
12786 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12790 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12787 } | 12791 } |
12788 | 12792 |
12789 #ifdef DEBUG | 12793 #ifdef DEBUG |
12790 graph_->Verify(false); // No full verify. | 12794 graph_->Verify(false); // No full verify. |
12791 #endif | 12795 #endif |
12792 } | 12796 } |
12793 | 12797 |
12794 } } // namespace v8::internal | 12798 } } // namespace v8::internal |
OLD | NEW |