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

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

Issue 1488493002: Use HType::JSReceiver instead of HType::JSObject in some places. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 5 years 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
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | no next file » | 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/crankshaft/hydrogen-instructions.h" 5 #include "src/crankshaft/hydrogen-instructions.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/safe_math.h" 8 #include "src/base/safe_math.h"
9 #include "src/crankshaft/hydrogen-infer-representation.h" 9 #include "src/crankshaft/hydrogen-infer-representation.h"
10 #include "src/double.h" 10 #include "src/double.h"
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 } 1517 }
1518 1518
1519 1519
1520 HValue* HChange::Canonicalize() { 1520 HValue* HChange::Canonicalize() {
1521 return (from().Equals(to())) ? value() : this; 1521 return (from().Equals(to())) ? value() : this;
1522 } 1522 }
1523 1523
1524 1524
1525 HValue* HWrapReceiver::Canonicalize() { 1525 HValue* HWrapReceiver::Canonicalize() {
1526 if (HasNoUses()) return NULL; 1526 if (HasNoUses()) return NULL;
1527 if (receiver()->type().IsJSObject()) { 1527 if (receiver()->type().IsJSReceiver()) {
1528 return receiver(); 1528 return receiver();
1529 } 1529 }
1530 return this; 1530 return this;
1531 } 1531 }
1532 1532
1533 1533
1534 std::ostream& HTypeof::PrintDataTo(std::ostream& os) const { // NOLINT 1534 std::ostream& HTypeof::PrintDataTo(std::ostream& os) const { // NOLINT
1535 return os << NameOf(value()); 1535 return os << NameOf(value());
1536 } 1536 }
1537 1537
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 } 1613 }
1614 1614
1615 return Prepend(HMathFloorOfDiv::New( 1615 return Prepend(HMathFloorOfDiv::New(
1616 block()->graph()->isolate(), block()->zone(), context(), left, right)); 1616 block()->graph()->isolate(), block()->zone(), context(), left, right));
1617 } 1617 }
1618 return this; 1618 return this;
1619 } 1619 }
1620 1620
1621 1621
1622 HValue* HCheckInstanceType::Canonicalize() { 1622 HValue* HCheckInstanceType::Canonicalize() {
1623 if ((check_ == IS_JS_RECEIVER && value()->type().IsJSObject()) || 1623 if ((check_ == IS_JS_RECEIVER && value()->type().IsJSReceiver()) ||
1624 (check_ == IS_JS_ARRAY && value()->type().IsJSArray()) || 1624 (check_ == IS_JS_ARRAY && value()->type().IsJSArray()) ||
1625 (check_ == IS_STRING && value()->type().IsString())) { 1625 (check_ == IS_STRING && value()->type().IsString())) {
1626 return value(); 1626 return value();
1627 } 1627 }
1628 1628
1629 if (check_ == IS_INTERNALIZED_STRING && value()->IsConstant()) { 1629 if (check_ == IS_INTERNALIZED_STRING && value()->IsConstant()) {
1630 if (HConstant::cast(value())->HasInternalizedStringValue()) { 1630 if (HConstant::cast(value())->HasInternalizedStringValue()) {
1631 return value(); 1631 return value();
1632 } 1632 }
1633 } 1633 }
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
3269 return true; 3269 return true;
3270 } 3270 }
3271 if (value()->type().IsString()) { 3271 if (value()->type().IsString()) {
3272 *block = FirstSuccessor(); 3272 *block = FirstSuccessor();
3273 return true; 3273 return true;
3274 } 3274 }
3275 if (value()->type().IsSmi() || 3275 if (value()->type().IsSmi() ||
3276 value()->type().IsNull() || 3276 value()->type().IsNull() ||
3277 value()->type().IsBoolean() || 3277 value()->type().IsBoolean() ||
3278 value()->type().IsUndefined() || 3278 value()->type().IsUndefined() ||
3279 value()->type().IsJSObject()) { 3279 value()->type().IsJSReceiver()) {
3280 *block = SecondSuccessor(); 3280 *block = SecondSuccessor();
3281 return true; 3281 return true;
3282 } 3282 }
3283 *block = NULL; 3283 *block = NULL;
3284 return false; 3284 return false;
3285 } 3285 }
3286 3286
3287 3287
3288 bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) { 3288 bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
3289 if (FLAG_fold_constants && value()->IsConstant()) { 3289 if (FLAG_fold_constants && value()->IsConstant()) {
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
4695 case HObjectAccess::kExternalMemory: 4695 case HObjectAccess::kExternalMemory:
4696 os << "[external-memory]"; 4696 os << "[external-memory]";
4697 break; 4697 break;
4698 } 4698 }
4699 4699
4700 return os << "@" << access.offset(); 4700 return os << "@" << access.offset();
4701 } 4701 }
4702 4702
4703 } // namespace internal 4703 } // namespace internal
4704 } // namespace v8 4704 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698