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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 7434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7445 if (function_state()->outer() == NULL) { | 7445 if (function_state()->outer() == NULL) { |
7446 HInstruction* elements = Add<HArgumentsElements>(false); | 7446 HInstruction* elements = Add<HArgumentsElements>(false); |
7447 result = New<HArgumentsLength>(elements); | 7447 result = New<HArgumentsLength>(elements); |
7448 } else { | 7448 } else { |
7449 // Number of arguments without receiver. | 7449 // Number of arguments without receiver. |
7450 int argument_count = environment()-> | 7450 int argument_count = environment()-> |
7451 arguments_environment()->parameter_count() - 1; | 7451 arguments_environment()->parameter_count() - 1; |
7452 result = New<HConstant>(argument_count); | 7452 result = New<HConstant>(argument_count); |
7453 } | 7453 } |
7454 } else { | 7454 } else { |
| 7455 // We need to take into account the KEYED_LOAD_IC feedback to guard the |
| 7456 // HBoundsCheck instructions below. |
| 7457 if (!expr->IsMonomorphic()) return false; |
7455 CHECK_ALIVE_OR_RETURN(VisitForValue(expr->obj(), ARGUMENTS_ALLOWED), true); | 7458 CHECK_ALIVE_OR_RETURN(VisitForValue(expr->obj(), ARGUMENTS_ALLOWED), true); |
7456 CHECK_ALIVE_OR_RETURN(VisitForValue(expr->key()), true); | 7459 CHECK_ALIVE_OR_RETURN(VisitForValue(expr->key()), true); |
7457 HValue* key = Pop(); | 7460 HValue* key = Pop(); |
7458 Drop(1); // Arguments object. | 7461 Drop(1); // Arguments object. |
7459 if (function_state()->outer() == NULL) { | 7462 if (function_state()->outer() == NULL) { |
7460 HInstruction* elements = Add<HArgumentsElements>(false); | 7463 HInstruction* elements = Add<HArgumentsElements>(false); |
7461 HInstruction* length = Add<HArgumentsLength>(elements); | 7464 HInstruction* length = Add<HArgumentsLength>(elements); |
7462 HInstruction* checked_key = Add<HBoundsCheck>(key, length); | 7465 HInstruction* checked_key = Add<HBoundsCheck>(key, length); |
7463 result = New<HAccessArgumentsAt>(elements, length, checked_key); | 7466 result = New<HAccessArgumentsAt>(elements, length, checked_key); |
7464 } else { | 7467 } else { |
(...skipping 5581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13046 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13049 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13047 } | 13050 } |
13048 | 13051 |
13049 #ifdef DEBUG | 13052 #ifdef DEBUG |
13050 graph_->Verify(false); // No full verify. | 13053 graph_->Verify(false); // No full verify. |
13051 #endif | 13054 #endif |
13052 } | 13055 } |
13053 | 13056 |
13054 } // namespace internal | 13057 } // namespace internal |
13055 } // namespace v8 | 13058 } // namespace v8 |
OLD | NEW |