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 5388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5399 } | 5399 } |
5400 } else { | 5400 } else { |
5401 HValue* global_object = Add<HLoadNamedField>( | 5401 HValue* global_object = Add<HLoadNamedField>( |
5402 context(), nullptr, | 5402 context(), nullptr, |
5403 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); | 5403 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); |
5404 HLoadGlobalGeneric* instr = | 5404 HLoadGlobalGeneric* instr = |
5405 New<HLoadGlobalGeneric>(global_object, | 5405 New<HLoadGlobalGeneric>(global_object, |
5406 variable->name(), | 5406 variable->name(), |
5407 ast_context()->is_for_typeof()); | 5407 ast_context()->is_for_typeof()); |
5408 if (FLAG_vector_ics) { | 5408 if (FLAG_vector_ics) { |
5409 instr->SetVectorAndSlot(handle(current_feedback_vector(), isolate()), | 5409 Handle<SharedFunctionInfo> current_shared = |
5410 expr->VariableFeedbackSlot()); | 5410 function_state()->compilation_info()->shared_info(); |
| 5411 instr->SetVectorAndSlot( |
| 5412 handle(current_shared->feedback_vector(), isolate()), |
| 5413 expr->VariableFeedbackSlot()); |
5411 } | 5414 } |
5412 return ast_context()->ReturnInstruction(instr, expr->id()); | 5415 return ast_context()->ReturnInstruction(instr, expr->id()); |
5413 } | 5416 } |
5414 } | 5417 } |
5415 | 5418 |
5416 case Variable::PARAMETER: | 5419 case Variable::PARAMETER: |
5417 case Variable::LOCAL: { | 5420 case Variable::LOCAL: { |
5418 HValue* value = LookupAndMakeLive(variable); | 5421 HValue* value = LookupAndMakeLive(variable); |
5419 if (value == graph()->GetConstantHole()) { | 5422 if (value == graph()->GetConstantHole()) { |
5420 DCHECK(IsDeclaredVariableMode(variable->mode()) && | 5423 DCHECK(IsDeclaredVariableMode(variable->mode()) && |
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6891 Handle<String> name, HValue* value, bool is_uninitialized) { | 6894 Handle<String> name, HValue* value, bool is_uninitialized) { |
6892 if (is_uninitialized) { | 6895 if (is_uninitialized) { |
6893 Add<HDeoptimize>( | 6896 Add<HDeoptimize>( |
6894 Deoptimizer::kInsufficientTypeFeedbackForGenericNamedAccess, | 6897 Deoptimizer::kInsufficientTypeFeedbackForGenericNamedAccess, |
6895 Deoptimizer::SOFT); | 6898 Deoptimizer::SOFT); |
6896 } | 6899 } |
6897 if (access_type == LOAD) { | 6900 if (access_type == LOAD) { |
6898 HLoadNamedGeneric* result = | 6901 HLoadNamedGeneric* result = |
6899 New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC); | 6902 New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC); |
6900 if (FLAG_vector_ics) { | 6903 if (FLAG_vector_ics) { |
| 6904 Handle<SharedFunctionInfo> current_shared = |
| 6905 function_state()->compilation_info()->shared_info(); |
6901 Handle<TypeFeedbackVector> vector = | 6906 Handle<TypeFeedbackVector> vector = |
6902 handle(current_feedback_vector(), isolate()); | 6907 handle(current_shared->feedback_vector(), isolate()); |
6903 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); | 6908 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
6904 result->SetVectorAndSlot(vector, slot); | 6909 result->SetVectorAndSlot(vector, slot); |
6905 } | 6910 } |
6906 return result; | 6911 return result; |
6907 } else { | 6912 } else { |
6908 return New<HStoreNamedGeneric>(object, name, value, | 6913 return New<HStoreNamedGeneric>(object, name, value, |
6909 function_language_mode(), PREMONOMORPHIC); | 6914 function_language_mode(), PREMONOMORPHIC); |
6910 } | 6915 } |
6911 } | 6916 } |
6912 | 6917 |
6913 | 6918 |
6914 | 6919 |
6915 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( | 6920 HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( |
6916 PropertyAccessType access_type, | 6921 PropertyAccessType access_type, |
6917 Expression* expr, | 6922 Expression* expr, |
6918 HValue* object, | 6923 HValue* object, |
6919 HValue* key, | 6924 HValue* key, |
6920 HValue* value) { | 6925 HValue* value) { |
6921 if (access_type == LOAD) { | 6926 if (access_type == LOAD) { |
6922 // HLoadKeyedGeneric with vector ics benefits from being encoded as | 6927 HLoadKeyedGeneric* result = |
6923 // MEGAMORPHIC because the vector/slot combo becomes unnecessary. | 6928 New<HLoadKeyedGeneric>(object, key, PREMONOMORPHIC); |
6924 HLoadKeyedGeneric* result = New<HLoadKeyedGeneric>( | 6929 if (FLAG_vector_ics) { |
6925 object, key, FLAG_vector_ics ? MEGAMORPHIC : PREMONOMORPHIC); | 6930 Handle<SharedFunctionInfo> current_shared = |
| 6931 function_state()->compilation_info()->shared_info(); |
| 6932 Handle<TypeFeedbackVector> vector = |
| 6933 handle(current_shared->feedback_vector(), isolate()); |
| 6934 FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
| 6935 result->SetVectorAndSlot(vector, slot); |
| 6936 } |
6926 return result; | 6937 return result; |
6927 } else { | 6938 } else { |
6928 return New<HStoreKeyedGeneric>(object, key, value, function_language_mode(), | 6939 return New<HStoreKeyedGeneric>(object, key, value, function_language_mode(), |
6929 PREMONOMORPHIC); | 6940 PREMONOMORPHIC); |
6930 } | 6941 } |
6931 } | 6942 } |
6932 | 6943 |
6933 | 6944 |
6934 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { | 6945 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { |
6935 // Loads from a "stock" fast holey double arrays can elide the hole check. | 6946 // Loads from a "stock" fast holey double arrays can elide the hole check. |
(...skipping 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9307 call = BuildCallConstantFunction(expr->target(), argument_count); | 9318 call = BuildCallConstantFunction(expr->target(), argument_count); |
9308 } else { | 9319 } else { |
9309 PushArgumentsFromEnvironment(argument_count); | 9320 PushArgumentsFromEnvironment(argument_count); |
9310 HCallFunction* call_function = | 9321 HCallFunction* call_function = |
9311 New<HCallFunction>(function, argument_count); | 9322 New<HCallFunction>(function, argument_count); |
9312 call = call_function; | 9323 call = call_function; |
9313 if (expr->is_uninitialized() && | 9324 if (expr->is_uninitialized() && |
9314 expr->IsUsingCallFeedbackICSlot(isolate())) { | 9325 expr->IsUsingCallFeedbackICSlot(isolate())) { |
9315 // We've never seen this call before, so let's have Crankshaft learn | 9326 // We've never seen this call before, so let's have Crankshaft learn |
9316 // through the type vector. | 9327 // through the type vector. |
| 9328 Handle<SharedFunctionInfo> current_shared = |
| 9329 function_state()->compilation_info()->shared_info(); |
9317 Handle<TypeFeedbackVector> vector = | 9330 Handle<TypeFeedbackVector> vector = |
9318 handle(current_feedback_vector(), isolate()); | 9331 handle(current_shared->feedback_vector(), isolate()); |
9319 FeedbackVectorICSlot slot = expr->CallFeedbackICSlot(); | 9332 FeedbackVectorICSlot slot = expr->CallFeedbackICSlot(); |
9320 call_function->SetVectorAndSlot(vector, slot); | 9333 call_function->SetVectorAndSlot(vector, slot); |
9321 } | 9334 } |
9322 } | 9335 } |
9323 } | 9336 } |
9324 | 9337 |
9325 Drop(1); // Drop the function. | 9338 Drop(1); // Drop the function. |
9326 return ast_context()->ReturnInstruction(call, expr->id()); | 9339 return ast_context()->ReturnInstruction(call, expr->id()); |
9327 } | 9340 } |
9328 | 9341 |
(...skipping 3618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12947 if (ShouldProduceTraceOutput()) { | 12960 if (ShouldProduceTraceOutput()) { |
12948 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12961 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12949 } | 12962 } |
12950 | 12963 |
12951 #ifdef DEBUG | 12964 #ifdef DEBUG |
12952 graph_->Verify(false); // No full verify. | 12965 graph_->Verify(false); // No full verify. |
12953 #endif | 12966 #endif |
12954 } | 12967 } |
12955 | 12968 |
12956 } } // namespace v8::internal | 12969 } } // namespace v8::internal |
OLD | NEW |