Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index 2d4b82bf16ba1efe84bbc0915111921069ad9384..29018f62817f4b64d4c204138b6c515d28c24b23 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -75,6 +75,12 @@ int HValue::LoopWeight() const { |
} |
+Isolate* HValue::isolate() const { |
+ ASSERT(block() != NULL); |
+ return block()->graph()->isolate(); |
+} |
+ |
+ |
void HValue::AssumeRepresentation(Representation r) { |
if (CheckFlag(kFlexibleRepresentation)) { |
ChangeRepresentation(r); |
@@ -341,10 +347,10 @@ const char* HType::ToString() { |
} |
-HType HType::TypeFromValue(Handle<Object> value) { |
+HType HType::TypeFromValue(Isolate* isolate, Handle<Object> value) { |
// Handle dereferencing is safe here: an object's type as checked below |
// never changes. |
- AllowHandleDereference allow_handle_deref; |
+ AllowHandleDereference allow_handle_deref(isolate); |
HType result = HType::Tagged(); |
if (value->IsSmi()) { |
@@ -1277,7 +1283,7 @@ HValue* HCheckInstanceType::Canonicalize() { |
if (check_ == IS_SYMBOL && value()->IsConstant()) { |
// Dereferencing is safe here: a symbol cannot become a non-symbol. |
- AllowHandleDereference allow_handle_deref; |
+ AllowHandleDereference allow_handle_deref(isolate()); |
if (HConstant::cast(value())->handle()->IsSymbol()) return NULL; |
} |
return this; |
@@ -1764,7 +1770,7 @@ HConstant::HConstant(Handle<Object> handle, Representation r) |
has_int32_value_(false), |
has_double_value_(false) { |
// Dereferencing here is safe: the value of a number object does not change. |
- AllowHandleDereference allow_handle_deref; |
+ AllowHandleDereference allow_handle_deref(Isolate::Current()); |
SetFlag(kUseGVN); |
if (handle_->IsNumber()) { |
double n = handle_->Number(); |
@@ -1845,7 +1851,7 @@ bool HConstant::ToBoolean() { |
} |
// Dereferencing is safe: singletons do not change and strings are |
// immutable. |
- AllowHandleDereference allow_handle_deref; |
+ AllowHandleDereference allow_handle_deref(isolate()); |
if (handle_->IsTrue()) return true; |
if (handle_->IsFalse()) return false; |
if (handle_->IsUndefined()) return false; |
@@ -2533,7 +2539,7 @@ HType HConstant::CalculateInferredType() { |
return Smi::IsValid(int32_value_) ? HType::Smi() : HType::HeapNumber(); |
} |
if (has_double_value_) return HType::HeapNumber(); |
- return HType::TypeFromValue(handle_); |
+ return HType::TypeFromValue(isolate(), handle_); |
} |