| 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 6889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6900 bool is_uninitialized) { | 6900 bool is_uninitialized) { |
| 6901 if (is_uninitialized) { | 6901 if (is_uninitialized) { |
| 6902 Add<HDeoptimize>("Insufficient type feedback for generic named access", | 6902 Add<HDeoptimize>("Insufficient type feedback for generic named access", |
| 6903 Deoptimizer::SOFT); | 6903 Deoptimizer::SOFT); |
| 6904 } | 6904 } |
| 6905 if (access_type == LOAD) { | 6905 if (access_type == LOAD) { |
| 6906 HLoadNamedGeneric* result = New<HLoadNamedGeneric>(object, name); | 6906 HLoadNamedGeneric* result = New<HLoadNamedGeneric>(object, name); |
| 6907 if (FLAG_vector_ics) { | 6907 if (FLAG_vector_ics) { |
| 6908 Handle<SharedFunctionInfo> current_shared = | 6908 Handle<SharedFunctionInfo> current_shared = |
| 6909 function_state()->compilation_info()->shared_info(); | 6909 function_state()->compilation_info()->shared_info(); |
| 6910 result->SetVectorAndSlot( | 6910 Handle<TypeFeedbackVector> vector = |
| 6911 handle(current_shared->feedback_vector(), isolate()), | 6911 handle(current_shared->feedback_vector(), isolate()); |
| 6912 expr->AsProperty()->PropertyFeedbackSlot()); | 6912 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
| 6913 result->SetVectorAndSlot(vector, slot); |
| 6913 } | 6914 } |
| 6914 return result; | 6915 return result; |
| 6915 } else { | 6916 } else { |
| 6916 return New<HStoreNamedGeneric>(object, name, value, function_strict_mode()); | 6917 return New<HStoreNamedGeneric>(object, name, value, function_strict_mode()); |
| 6917 } | 6918 } |
| 6918 } | 6919 } |
| 6919 | 6920 |
| 6920 | 6921 |
| 6921 | 6922 |
| 6922 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( | 6923 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( |
| 6923 PropertyAccessType access_type, | 6924 PropertyAccessType access_type, |
| 6924 Expression* expr, | 6925 Expression* expr, |
| 6925 HValue* object, | 6926 HValue* object, |
| 6926 HValue* key, | 6927 HValue* key, |
| 6927 HValue* value) { | 6928 HValue* value) { |
| 6928 if (access_type == LOAD) { | 6929 if (access_type == LOAD) { |
| 6929 HLoadKeyedGeneric* result = New<HLoadKeyedGeneric>(object, key); | 6930 HLoadKeyedGeneric* result = New<HLoadKeyedGeneric>(object, key); |
| 6930 if (FLAG_vector_ics) { | 6931 if (FLAG_vector_ics) { |
| 6931 Handle<SharedFunctionInfo> current_shared = | 6932 Handle<SharedFunctionInfo> current_shared = |
| 6932 function_state()->compilation_info()->shared_info(); | 6933 function_state()->compilation_info()->shared_info(); |
| 6933 result->SetVectorAndSlot( | 6934 Handle<TypeFeedbackVector> vector = |
| 6934 handle(current_shared->feedback_vector(), isolate()), | 6935 handle(current_shared->feedback_vector(), isolate()); |
| 6935 expr->AsProperty()->PropertyFeedbackSlot()); | 6936 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
| 6937 result->SetVectorAndSlot(vector, slot); |
| 6936 } | 6938 } |
| 6937 return result; | 6939 return result; |
| 6938 } else { | 6940 } else { |
| 6939 return New<HStoreKeyedGeneric>(object, key, value, function_strict_mode()); | 6941 return New<HStoreKeyedGeneric>(object, key, value, function_strict_mode()); |
| 6940 } | 6942 } |
| 6941 } | 6943 } |
| 6942 | 6944 |
| 6943 | 6945 |
| 6944 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { | 6946 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { |
| 6945 // Loads from a "stock" fast holey double arrays can elide the hole check. | 6947 // 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... |
| 7201 FinishExitWithHardDeoptimization("Unknown map in polymorphic element access"); | 7203 FinishExitWithHardDeoptimization("Unknown map in polymorphic element access"); |
| 7202 set_current_block(join); | 7204 set_current_block(join); |
| 7203 return access_type == STORE ? val : Pop(); | 7205 return access_type == STORE ? val : Pop(); |
| 7204 } | 7206 } |
| 7205 | 7207 |
| 7206 | 7208 |
| 7207 HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess( | 7209 HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess( |
| 7208 HValue* obj, HValue* key, HValue* val, Expression* expr, BailoutId ast_id, | 7210 HValue* obj, HValue* key, HValue* val, Expression* expr, BailoutId ast_id, |
| 7209 BailoutId return_id, PropertyAccessType access_type, | 7211 BailoutId return_id, PropertyAccessType access_type, |
| 7210 bool* has_side_effects) { | 7212 bool* has_side_effects) { |
| 7211 if (key->ActualValue()->IsConstant()) { | 7213 // TODO(mvstanton): This optimization causes trouble for vector-based |
| 7214 // KeyedLoadICs, turn it off for now. |
| 7215 if (!FLAG_vector_ics && key->ActualValue()->IsConstant()) { |
| 7212 Handle<Object> constant = | 7216 Handle<Object> constant = |
| 7213 HConstant::cast(key->ActualValue())->handle(isolate()); | 7217 HConstant::cast(key->ActualValue())->handle(isolate()); |
| 7214 uint32_t array_index; | 7218 uint32_t array_index; |
| 7215 if (constant->IsString() && | 7219 if (constant->IsString() && |
| 7216 !Handle<String>::cast(constant)->AsArrayIndex(&array_index)) { | 7220 !Handle<String>::cast(constant)->AsArrayIndex(&array_index)) { |
| 7217 if (!constant->IsUniqueName()) { | 7221 if (!constant->IsUniqueName()) { |
| 7218 constant = isolate()->factory()->InternalizeString( | 7222 constant = isolate()->factory()->InternalizeString( |
| 7219 Handle<String>::cast(constant)); | 7223 Handle<String>::cast(constant)); |
| 7220 } | 7224 } |
| 7221 HInstruction* instr = | 7225 HInstruction* instr = |
| (...skipping 6265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13487 if (ShouldProduceTraceOutput()) { | 13491 if (ShouldProduceTraceOutput()) { |
| 13488 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13492 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13489 } | 13493 } |
| 13490 | 13494 |
| 13491 #ifdef DEBUG | 13495 #ifdef DEBUG |
| 13492 graph_->Verify(false); // No full verify. | 13496 graph_->Verify(false); // No full verify. |
| 13493 #endif | 13497 #endif |
| 13494 } | 13498 } |
| 13495 | 13499 |
| 13496 } } // namespace v8::internal | 13500 } } // namespace v8::internal |
| OLD | NEW |