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

Unified Diff: src/crankshaft/hydrogen-instructions.cc

Issue 2498563002: [cleanup] Replace ToBooleanICStub::Types with ToBooleanHints (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/hydrogen-osr.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.cc
diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc
index 465a18ae46e6145d08cb35d5156306cc3ab378d3..6c8d3131233fd0a8e2e584463b024610f0f1639b 100644
--- a/src/crankshaft/hydrogen-instructions.cc
+++ b/src/crankshaft/hydrogen-instructions.cc
@@ -7,6 +7,7 @@
#include "src/base/bits.h"
#include "src/base/ieee754.h"
#include "src/base/safe_math.h"
+#include "src/codegen.h"
#include "src/crankshaft/hydrogen-infer-representation.h"
#include "src/double.h"
#include "src/elements.h"
@@ -44,6 +45,21 @@ namespace internal {
HYDROGEN_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE)
#undef DEFINE_COMPILE
+Representation RepresentationFromMachineType(MachineType type) {
+ if (type == MachineType::Int32()) {
+ return Representation::Integer32();
+ }
+
+ if (type == MachineType::TaggedSigned()) {
+ return Representation::Smi();
+ }
+
+ if (type == MachineType::Pointer()) {
+ return Representation::External();
+ }
+
+ return Representation::Tagged();
+}
Isolate* HValue::isolate() const {
DCHECK(block() != NULL);
@@ -1056,23 +1072,21 @@ std::ostream& HReturn::PrintDataTo(std::ostream& os) const { // NOLINT
Representation HBranch::observed_input_representation(int index) {
- if (expected_input_types_.Contains(ToBooleanICStub::NULL_TYPE) ||
- expected_input_types_.Contains(ToBooleanICStub::SPEC_OBJECT) ||
- expected_input_types_.Contains(ToBooleanICStub::STRING) ||
- expected_input_types_.Contains(ToBooleanICStub::SYMBOL) ||
- expected_input_types_.Contains(ToBooleanICStub::SIMD_VALUE)) {
+ if (expected_input_types_ & (ToBooleanHint::kNull | ToBooleanHint::kReceiver |
+ ToBooleanHint::kString | ToBooleanHint::kSymbol |
+ ToBooleanHint::kSimdValue)) {
return Representation::Tagged();
}
- if (expected_input_types_.Contains(ToBooleanICStub::UNDEFINED)) {
- if (expected_input_types_.Contains(ToBooleanICStub::HEAP_NUMBER)) {
+ if (expected_input_types_ & ToBooleanHint::kUndefined) {
+ if (expected_input_types_ & ToBooleanHint::kHeapNumber) {
return Representation::Double();
}
return Representation::Tagged();
}
- if (expected_input_types_.Contains(ToBooleanICStub::HEAP_NUMBER)) {
+ if (expected_input_types_ & ToBooleanHint::kHeapNumber) {
return Representation::Double();
}
- if (expected_input_types_.Contains(ToBooleanICStub::SMI)) {
+ if (expected_input_types_ & ToBooleanHint::kSmallInteger) {
return Representation::Smi();
}
return Representation::None();
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/hydrogen-osr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698