summaryrefslogtreecommitdiff
path: root/deps/v8/src/hydrogen-instructions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/hydrogen-instructions.cc')
-rw-r--r--deps/v8/src/hydrogen-instructions.cc70
1 files changed, 53 insertions, 17 deletions
diff --git a/deps/v8/src/hydrogen-instructions.cc b/deps/v8/src/hydrogen-instructions.cc
index 2843195e86..770d710a3a 100644
--- a/deps/v8/src/hydrogen-instructions.cc
+++ b/deps/v8/src/hydrogen-instructions.cc
@@ -820,6 +820,7 @@ bool HInstruction::CanDeoptimize() {
case HValue::kLeaveInlined:
case HValue::kLoadFieldByIndex:
case HValue::kLoadGlobalGeneric:
+ case HValue::kLoadGlobalViaContext:
case HValue::kLoadNamedField:
case HValue::kLoadNamedGeneric:
case HValue::kLoadRoot:
@@ -833,6 +834,7 @@ bool HInstruction::CanDeoptimize() {
case HValue::kSeqStringGetChar:
case HValue::kStoreCodeEntry:
case HValue::kStoreFrameContext:
+ case HValue::kStoreGlobalViaContext:
case HValue::kStoreKeyed:
case HValue::kStoreNamedField:
case HValue::kStoreNamedGeneric:
@@ -1158,7 +1160,8 @@ Representation HBranch::observed_input_representation(int index) {
if (expected_input_types_.Contains(ToBooleanStub::NULL_TYPE) ||
expected_input_types_.Contains(ToBooleanStub::SPEC_OBJECT) ||
expected_input_types_.Contains(ToBooleanStub::STRING) ||
- expected_input_types_.Contains(ToBooleanStub::SYMBOL)) {
+ expected_input_types_.Contains(ToBooleanStub::SYMBOL) ||
+ expected_input_types_.Contains(ToBooleanStub::SIMD_VALUE)) {
return Representation::Tagged();
}
if (expected_input_types_.Contains(ToBooleanStub::UNDEFINED)) {
@@ -1323,6 +1326,17 @@ static String* TypeOfString(HConstant* constant, Isolate* isolate) {
}
case SYMBOL_TYPE:
return heap->symbol_string();
+ case SIMD128_VALUE_TYPE: {
+ Unique<Map> map = constant->ObjectMap();
+#define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
+ if (map.IsKnownGlobal(heap->type##_map())) { \
+ return heap->type##_string(); \
+ }
+ SIMD128_TYPES(SIMD128_TYPE)
+#undef SIMD128_TYPE
+ UNREACHABLE();
+ return nullptr;
+ }
case JS_FUNCTION_TYPE:
case JS_FUNCTION_PROXY_TYPE:
return heap->function_string();
@@ -1427,6 +1441,17 @@ HValue* HBitwise::Canonicalize() {
}
+// static
+HInstruction* HAdd::New(Isolate* isolate, Zone* zone, HValue* context,
+ HValue* left, HValue* right, Strength strength,
+ ExternalAddType external_add_type) {
+ // For everything else, you should use the other factory method without
+ // ExternalAddType.
+ DCHECK_EQ(external_add_type, AddOfExternalAndTagged);
+ return new (zone) HAdd(context, left, right, strength, external_add_type);
+}
+
+
Representation HAdd::RepresentationFromInputs() {
Representation left_rep = left()->representation();
if (left_rep.IsExternal()) {
@@ -1440,7 +1465,11 @@ Representation HAdd::RequiredInputRepresentation(int index) {
if (index == 2) {
Representation left_rep = left()->representation();
if (left_rep.IsExternal()) {
- return Representation::Integer32();
+ if (external_add_type_ == AddOfExternalAndTagged) {
+ return Representation::Tagged();
+ } else {
+ return Representation::Integer32();
+ }
}
}
return HArithmeticBinaryOperation::RequiredInputRepresentation(index);
@@ -3187,18 +3216,13 @@ Range* HLoadNamedField::InferRange(Zone* zone) {
Range* HLoadKeyed::InferRange(Zone* zone) {
switch (elements_kind()) {
- case EXTERNAL_INT8_ELEMENTS:
case INT8_ELEMENTS:
return new(zone) Range(kMinInt8, kMaxInt8);
- case EXTERNAL_UINT8_ELEMENTS:
- case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
case UINT8_ELEMENTS:
case UINT8_CLAMPED_ELEMENTS:
return new(zone) Range(kMinUInt8, kMaxUInt8);
- case EXTERNAL_INT16_ELEMENTS:
case INT16_ELEMENTS:
return new(zone) Range(kMinInt16, kMaxInt16);
- case EXTERNAL_UINT16_ELEMENTS:
case UINT16_ELEMENTS:
return new(zone) Range(kMinUInt16, kMaxUInt16);
default:
@@ -3441,11 +3465,11 @@ std::ostream& HLoadNamedGeneric::PrintDataTo(
std::ostream& HLoadKeyed::PrintDataTo(std::ostream& os) const { // NOLINT
- if (!is_external()) {
+ if (!is_fixed_typed_array()) {
os << NameOf(elements());
} else {
- DCHECK(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND &&
- elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND);
+ DCHECK(elements_kind() >= FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND &&
+ elements_kind() <= LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND);
os << NameOf(elements()) << "." << ElementsKindToString(elements_kind());
}
@@ -3480,7 +3504,7 @@ bool HLoadKeyed::UsesMustHandleHole() const {
return false;
}
- if (IsExternalArrayElementsKind(elements_kind())) {
+ if (IsFixedTypedArrayElementsKind(elements_kind())) {
return false;
}
@@ -3520,7 +3544,7 @@ bool HLoadKeyed::RequiresHoleCheck() const {
return false;
}
- if (IsExternalArrayElementsKind(elements_kind())) {
+ if (IsFixedTypedArrayElementsKind(elements_kind())) {
return false;
}
@@ -3579,6 +3603,13 @@ std::ostream& HStoreNamedGeneric::PrintDataTo(
}
+std::ostream& HStoreGlobalViaContext::PrintDataTo(
+ std::ostream& os) const { // NOLINT
+ return os << " depth:" << depth() << " slot:" << slot_index() << " = "
+ << NameOf(value());
+}
+
+
std::ostream& HStoreNamedField::PrintDataTo(std::ostream& os) const { // NOLINT
os << NameOf(object()) << access_ << " = " << NameOf(value());
if (NeedsWriteBarrier()) os << " (write-barrier)";
@@ -3588,11 +3619,11 @@ std::ostream& HStoreNamedField::PrintDataTo(std::ostream& os) const { // NOLINT
std::ostream& HStoreKeyed::PrintDataTo(std::ostream& os) const { // NOLINT
- if (!is_external()) {
+ if (!is_fixed_typed_array()) {
os << NameOf(elements());
} else {
- DCHECK(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND &&
- elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND);
+ DCHECK(elements_kind() >= FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND &&
+ elements_kind() <= LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND);
os << NameOf(elements()) << "." << ElementsKindToString(elements_kind());
}
@@ -3629,6 +3660,12 @@ std::ostream& HLoadGlobalGeneric::PrintDataTo(
}
+std::ostream& HLoadGlobalViaContext::PrintDataTo(
+ std::ostream& os) const { // NOLINT
+ return os << "depth:" << depth() << " slot:" << slot_index();
+}
+
+
std::ostream& HInnerAllocatedObject::PrintDataTo(
std::ostream& os) const { // NOLINT
os << NameOf(base_object()) << " offset ";
@@ -3949,8 +3986,7 @@ bool HStoreKeyed::NeedsCanonicalization() {
switch (value()->opcode()) {
case kLoadKeyed: {
ElementsKind load_kind = HLoadKeyed::cast(value())->elements_kind();
- return IsExternalFloatOrDoubleElementsKind(load_kind) ||
- IsFixedFloatElementsKind(load_kind);
+ return IsFixedFloatElementsKind(load_kind);
}
case kChange: {
Representation from = HChange::cast(value())->from();