| 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();
|
|
|