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.cc112
1 files changed, 48 insertions, 64 deletions
diff --git a/deps/v8/src/hydrogen-instructions.cc b/deps/v8/src/hydrogen-instructions.cc
index 2db3c43c68..2843195e86 100644
--- a/deps/v8/src/hydrogen-instructions.cc
+++ b/deps/v8/src/hydrogen-instructions.cc
@@ -6,6 +6,7 @@
#include "src/base/bits.h"
#include "src/double.h"
+#include "src/elements.h"
#include "src/factory.h"
#include "src/hydrogen-infer-representation.h"
@@ -837,7 +838,6 @@ bool HInstruction::CanDeoptimize() {
case HValue::kStoreNamedGeneric:
case HValue::kStringCharCodeAt:
case HValue::kStringCharFromCode:
- case HValue::kTailCallThroughMegamorphicCache:
case HValue::kThisFunction:
case HValue::kTypeofIsAndBranch:
case HValue::kUnknownOSRValue:
@@ -874,6 +874,7 @@ bool HInstruction::CanDeoptimize() {
case HValue::kLoadKeyed:
case HValue::kLoadKeyedGeneric:
case HValue::kMathFloorOfDiv:
+ case HValue::kMaybeGrowElements:
case HValue::kMod:
case HValue::kMul:
case HValue::kOsrEntry:
@@ -1626,6 +1627,9 @@ void HCheckInstanceType::GetCheckInterval(InstanceType* first,
case IS_JS_ARRAY:
*first = *last = JS_ARRAY_TYPE;
return;
+ case IS_JS_DATE:
+ *first = *last = JS_DATE_TYPE;
+ return;
default:
UNREACHABLE();
}
@@ -1695,6 +1699,8 @@ const char* HCheckInstanceType::GetCheckName() const {
switch (check_) {
case IS_SPEC_OBJECT: return "object";
case IS_JS_ARRAY: return "array";
+ case IS_JS_DATE:
+ return "date";
case IS_STRING: return "string";
case IS_INTERNALIZED_STRING: return "internalized_string";
}
@@ -1716,22 +1722,6 @@ std::ostream& HCallStub::PrintDataTo(std::ostream& os) const { // NOLINT
}
-Code::Flags HTailCallThroughMegamorphicCache::flags() const {
- Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags(
- Code::ComputeHandlerFlags(Code::LOAD_IC));
- return code_flags;
-}
-
-
-std::ostream& HTailCallThroughMegamorphicCache::PrintDataTo(
- std::ostream& os) const { // NOLINT
- for (int i = 0; i < OperandCount(); i++) {
- os << NameOf(OperandAt(i)) << " ";
- }
- return os << "flags: " << flags();
-}
-
-
std::ostream& HUnknownOSRValue::PrintDataTo(std::ostream& os) const { // NOLINT
const char* type = "expression";
if (environment_->is_local_index(index_)) type = "local";
@@ -2975,7 +2965,7 @@ std::ostream& HConstant::PrintDataTo(std::ostream& os) const { // NOLINT
os << reinterpret_cast<void*>(external_reference_value_.address()) << " ";
} else {
// The handle() method is silently and lazily mutating the object.
- Handle<Object> h = const_cast<HConstant*>(this)->handle(Isolate::Current());
+ Handle<Object> h = const_cast<HConstant*>(this)->handle(isolate());
os << Brief(*h) << " ";
if (HasStableMapValue()) os << "[stable-map] ";
if (HasObjectMap()) os << "[map " << *ObjectMap().handle() << "] ";
@@ -3414,7 +3404,7 @@ void HCompareNumericAndBranch::InferRepresentation(
// (false). Therefore, any comparisons other than ordered relational
// comparisons must cause a deopt when one of their arguments is undefined.
// See also v8:1434
- if (Token::IsOrderedRelationalCompareOp(token_)) {
+ if (Token::IsOrderedRelationalCompareOp(token_) && !is_strong(strength())) {
SetFlag(kAllowUndefinedAsNaN);
}
}
@@ -3982,22 +3972,21 @@ bool HStoreKeyed::NeedsCanonicalization() {
#define H_CONSTANT_DOUBLE(val) \
HConstant::New(isolate, zone, context, static_cast<double>(val))
-#define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op) \
- HInstruction* HInstr::New(Isolate* isolate, Zone* zone, HValue* context, \
- HValue* left, HValue* right, \
- LanguageMode language_mode) { \
- if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
- HConstant* c_left = HConstant::cast(left); \
- HConstant* c_right = HConstant::cast(right); \
- if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
- double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \
- if (IsInt32Double(double_res)) { \
- return H_CONSTANT_INT(double_res); \
- } \
- return H_CONSTANT_DOUBLE(double_res); \
- } \
- } \
- return new (zone) HInstr(context, left, right, language_mode); \
+#define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op) \
+ HInstruction* HInstr::New(Isolate* isolate, Zone* zone, HValue* context, \
+ HValue* left, HValue* right, Strength strength) { \
+ if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
+ HConstant* c_left = HConstant::cast(left); \
+ HConstant* c_right = HConstant::cast(right); \
+ if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
+ double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \
+ if (IsInt32Double(double_res)) { \
+ return H_CONSTANT_INT(double_res); \
+ } \
+ return H_CONSTANT_DOUBLE(double_res); \
+ } \
+ } \
+ return new (zone) HInstr(context, left, right, strength); \
}
@@ -4009,8 +3998,7 @@ DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HSub, -)
HInstruction* HStringAdd::New(Isolate* isolate, Zone* zone, HValue* context,
- HValue* left, HValue* right,
- LanguageMode language_mode,
+ HValue* left, HValue* right, Strength strength,
PretenureFlag pretenure_flag,
StringAddFlags flags,
Handle<AllocationSite> allocation_site) {
@@ -4028,9 +4016,8 @@ HInstruction* HStringAdd::New(Isolate* isolate, Zone* zone, HValue* context,
}
}
}
- return new(zone) HStringAdd(
- context, left, right, language_mode, pretenure_flag, flags,
- allocation_site);
+ return new (zone) HStringAdd(context, left, right, strength, pretenure_flag,
+ flags, allocation_site);
}
@@ -4228,8 +4215,7 @@ HInstruction* HMathMinMax::New(Isolate* isolate, Zone* zone, HValue* context,
HInstruction* HMod::New(Isolate* isolate, Zone* zone, HValue* context,
- HValue* left, HValue* right,
- LanguageMode language_mode) {
+ HValue* left, HValue* right, Strength strength) {
if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
HConstant* c_left = HConstant::cast(left);
HConstant* c_right = HConstant::cast(right);
@@ -4248,13 +4234,12 @@ HInstruction* HMod::New(Isolate* isolate, Zone* zone, HValue* context,
}
}
}
- return new(zone) HMod(context, left, right, language_mode);
+ return new (zone) HMod(context, left, right, strength);
}
HInstruction* HDiv::New(Isolate* isolate, Zone* zone, HValue* context,
- HValue* left, HValue* right,
- LanguageMode language_mode) {
+ HValue* left, HValue* right, Strength strength) {
// If left and right are constant values, try to return a constant value.
if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
HConstant* c_left = HConstant::cast(left);
@@ -4273,13 +4258,13 @@ HInstruction* HDiv::New(Isolate* isolate, Zone* zone, HValue* context,
}
}
}
- return new(zone) HDiv(context, left, right, language_mode);
+ return new (zone) HDiv(context, left, right, strength);
}
HInstruction* HBitwise::New(Isolate* isolate, Zone* zone, HValue* context,
Token::Value op, HValue* left, HValue* right,
- LanguageMode language_mode) {
+ Strength strength) {
if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
HConstant* c_left = HConstant::cast(left);
HConstant* c_right = HConstant::cast(right);
@@ -4304,22 +4289,21 @@ HInstruction* HBitwise::New(Isolate* isolate, Zone* zone, HValue* context,
return H_CONSTANT_INT(result);
}
}
- return new(zone) HBitwise(context, op, left, right, language_mode);
+ return new (zone) HBitwise(context, op, left, right, strength);
}
-#define DEFINE_NEW_H_BITWISE_INSTR(HInstr, result) \
- HInstruction* HInstr::New(Isolate* isolate, Zone* zone, HValue* context, \
- HValue* left, HValue* right, \
- LanguageMode language_mode) { \
- if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
- HConstant* c_left = HConstant::cast(left); \
- HConstant* c_right = HConstant::cast(right); \
- if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
- return H_CONSTANT_INT(result); \
- } \
- } \
- return new (zone) HInstr(context, left, right, language_mode); \
+#define DEFINE_NEW_H_BITWISE_INSTR(HInstr, result) \
+ HInstruction* HInstr::New(Isolate* isolate, Zone* zone, HValue* context, \
+ HValue* left, HValue* right, Strength strength) { \
+ if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
+ HConstant* c_left = HConstant::cast(left); \
+ HConstant* c_right = HConstant::cast(right); \
+ if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
+ return H_CONSTANT_INT(result); \
+ } \
+ } \
+ return new (zone) HInstr(context, left, right, strength); \
}
@@ -4332,8 +4316,7 @@ c_left->NumberValueAsInteger32() << (c_right->NumberValueAsInteger32() & 0x1f))
HInstruction* HShr::New(Isolate* isolate, Zone* zone, HValue* context,
- HValue* left, HValue* right,
- LanguageMode language_mode) {
+ HValue* left, HValue* right, Strength strength) {
if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
HConstant* c_left = HConstant::cast(left);
HConstant* c_right = HConstant::cast(right);
@@ -4346,7 +4329,7 @@ HInstruction* HShr::New(Isolate* isolate, Zone* zone, HValue* context,
return H_CONSTANT_INT(static_cast<uint32_t>(left_val) >> right_val);
}
}
- return new(zone) HShr(context, left, right, language_mode);
+ return new (zone) HShr(context, left, right, strength);
}
@@ -4730,4 +4713,5 @@ std::ostream& operator<<(std::ostream& os, const HObjectAccess& access) {
return os << "@" << access.offset();
}
-} } // namespace v8::internal
+} // namespace internal
+} // namespace v8