Chromium Code Reviews| Index: src/hydrogen-instructions.cc |
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
| index 16f502ddaf7b11f3d9600ecd40b025dc899e38d1..86960a6a2c20649ee2359fa193e789cf3efa4d52 100644 |
| --- a/src/hydrogen-instructions.cc |
| +++ b/src/hydrogen-instructions.cc |
| @@ -461,6 +461,23 @@ HType HType::TypeFromValue(Handle<Object> value) { |
| } |
| +Handle< ::v8::internal::Type> HType::intersect( |
| + Handle< ::v8::internal::Type> type, Isolate* isolate) { |
| + if (IsSmi()) return handle(::v8::internal::Type::Smi(), isolate); |
|
Jakob Kummerow
2013/07/18 11:56:15
This is not a generic implementation of intersecti
|
| + if (IsString()) return handle(::v8::internal::Type::String(), isolate); |
| + if (IsBoolean()) return handle(::v8::internal::Type::Boolean(), isolate); |
| + if (IsHeapNumber() || IsTaggedNumber()) { |
| + return handle(::v8::internal::Type::Intersect( |
| + type, handle(::v8::internal::Type::Number(), isolate)), isolate); |
| + } |
| + if (IsNonPrimitive() || IsJSObject()) { |
| + return handle(::v8::internal::Type::Intersect( |
| + type, handle(::v8::internal::Type::NonSmi(), isolate)), isolate); |
| + } |
| + return type; |
| +} |
| + |
| + |
| bool HValue::Dominates(HValue* dominator, HValue* dominated) { |
| if (dominator->block() != dominated->block()) { |
| // If they are in different blocks we can use the dominance relation |