Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: src/hydrogen.cc

Issue 313073003: Fix invalid loop condition for Array.lastIndexOf(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-380512.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-380512.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698