| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 8367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8378 LoopBuilder::Direction direction; | 8378 LoopBuilder::Direction direction; |
| 8379 if (mode == kFirstIndexOf) { | 8379 if (mode == kFirstIndexOf) { |
| 8380 initial = graph()->GetConstant0(); | 8380 initial = graph()->GetConstant0(); |
| 8381 terminating = length; | 8381 terminating = length; |
| 8382 token = Token::LT; | 8382 token = Token::LT; |
| 8383 direction = LoopBuilder::kPostIncrement; | 8383 direction = LoopBuilder::kPostIncrement; |
| 8384 } else { | 8384 } else { |
| 8385 ASSERT_EQ(kLastIndexOf, mode); | 8385 ASSERT_EQ(kLastIndexOf, mode); |
| 8386 initial = length; | 8386 initial = length; |
| 8387 terminating = graph()->GetConstant0(); | 8387 terminating = graph()->GetConstant0(); |
| 8388 token = Token::GTE; | 8388 token = Token::GT; |
| 8389 direction = LoopBuilder::kPreDecrement; | 8389 direction = LoopBuilder::kPreDecrement; |
| 8390 } | 8390 } |
| 8391 | 8391 |
| 8392 Push(graph()->GetConstantMinus1()); | 8392 Push(graph()->GetConstantMinus1()); |
| 8393 if (IsFastDoubleElementsKind(kind) || IsFastSmiElementsKind(kind)) { | 8393 if (IsFastDoubleElementsKind(kind) || IsFastSmiElementsKind(kind)) { |
| 8394 LoopBuilder loop(this, context(), direction); | 8394 LoopBuilder loop(this, context(), direction); |
| 8395 { | 8395 { |
| 8396 HValue* index = loop.BeginBody(initial, terminating, token); | 8396 HValue* index = loop.BeginBody(initial, terminating, token); |
| 8397 HValue* element = AddUncasted<HLoadKeyed>( | 8397 HValue* element = AddUncasted<HLoadKeyed>( |
| 8398 elements, index, static_cast<HValue*>(NULL), | 8398 elements, index, static_cast<HValue*>(NULL), |
| (...skipping 3656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12055 if (ShouldProduceTraceOutput()) { | 12055 if (ShouldProduceTraceOutput()) { |
| 12056 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12056 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12057 } | 12057 } |
| 12058 | 12058 |
| 12059 #ifdef DEBUG | 12059 #ifdef DEBUG |
| 12060 graph_->Verify(false); // No full verify. | 12060 graph_->Verify(false); // No full verify. |
| 12061 #endif | 12061 #endif |
| 12062 } | 12062 } |
| 12063 | 12063 |
| 12064 } } // namespace v8::internal | 12064 } } // namespace v8::internal |
| OLD | NEW |