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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 319343002: Bugfix in inlined versions of Array.indexOf() and Array.lastIndexOf() with a regression test. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing 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 | « src/hydrogen.cc ('k') | test/mjsunit/regress/regress-crbug-381534.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/double.h" 7 #include "src/double.h"
8 #include "src/factory.h" 8 #include "src/factory.h"
9 #include "src/hydrogen-infer-representation.h" 9 #include "src/hydrogen-infer-representation.h"
10 #include "src/property-details-inl.h" 10 #include "src/property-details-inl.h"
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 value()->PrintNameTo(stream); 1533 value()->PrintNameTo(stream);
1534 } 1534 }
1535 1535
1536 1536
1537 HInstruction* HForceRepresentation::New(Zone* zone, HValue* context, 1537 HInstruction* HForceRepresentation::New(Zone* zone, HValue* context,
1538 HValue* value, Representation representation) { 1538 HValue* value, Representation representation) {
1539 if (FLAG_fold_constants && value->IsConstant()) { 1539 if (FLAG_fold_constants && value->IsConstant()) {
1540 HConstant* c = HConstant::cast(value); 1540 HConstant* c = HConstant::cast(value);
1541 if (c->HasNumberValue()) { 1541 if (c->HasNumberValue()) {
1542 double double_res = c->DoubleValue(); 1542 double double_res = c->DoubleValue();
1543 if (representation.CanContainDouble(double_res)) { 1543 if (representation.IsDouble()) {
1544 return HConstant::New(zone, context, double_res);
1545
1546 } else if (representation.CanContainDouble(double_res)) {
1544 return HConstant::New(zone, context, 1547 return HConstant::New(zone, context,
1545 static_cast<int32_t>(double_res), 1548 static_cast<int32_t>(double_res),
1546 representation); 1549 representation);
1547 } 1550 }
1548 } 1551 }
1549 } 1552 }
1550 return new(zone) HForceRepresentation(value, representation); 1553 return new(zone) HForceRepresentation(value, representation);
1551 } 1554 }
1552 1555
1553 1556
(...skipping 3282 matching lines...) Expand 10 before | Expand all | Expand 10 after
4836 break; 4839 break;
4837 case kExternalMemory: 4840 case kExternalMemory:
4838 stream->Add("[external-memory]"); 4841 stream->Add("[external-memory]");
4839 break; 4842 break;
4840 } 4843 }
4841 4844
4842 stream->Add("@%d", offset()); 4845 stream->Add("@%d", offset());
4843 } 4846 }
4844 4847
4845 } } // namespace v8::internal 4848 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | test/mjsunit/regress/regress-crbug-381534.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698