Index: src/compiler/types.cc |
diff --git a/src/compiler/types.cc b/src/compiler/types.cc |
index a66e15a9abcc4bd5bb2bb124f96e13988bdd5144..cc1a002b8be83b43c4adb441b34e988e01c87579 100644 |
--- a/src/compiler/types.cc |
+++ b/src/compiler/types.cc |
@@ -196,7 +196,17 @@ Type::bitset BitsetType::Lub(i::Map* map) { |
case JS_GLOBAL_PROXY_TYPE: |
case JS_API_OBJECT_TYPE: |
case JS_SPECIAL_API_OBJECT_TYPE: |
- if (map->is_undetectable()) return kOtherUndetectable; |
+ if (map->is_undetectable()) { |
+ // Currently we assume that every undetectable receiver is also |
+ // callable, which is what we need to support document.all. We |
+ // could add another Type bit to support other use cases in the |
+ // future if necessary. |
+ DCHECK(map->is_callable()); |
+ return kOtherUndetectable; |
+ } |
+ if (map->is_callable()) { |
+ return kOtherCallable; |
+ } |
return kOtherObject; |
case JS_VALUE_TYPE: |
case JS_MESSAGE_OBJECT_TYPE: |
@@ -255,15 +265,19 @@ Type::bitset BitsetType::Lub(i::Map* map) { |
case JS_WEAK_MAP_TYPE: |
case JS_WEAK_SET_TYPE: |
case JS_PROMISE_TYPE: |
- case JS_BOUND_FUNCTION_TYPE: |
+ DCHECK(!map->is_callable()); |
DCHECK(!map->is_undetectable()); |
return kOtherObject; |
+ case JS_BOUND_FUNCTION_TYPE: |
+ DCHECK(!map->is_undetectable()); |
+ return kBoundFunction; |
case JS_FUNCTION_TYPE: |
DCHECK(!map->is_undetectable()); |
return kFunction; |
case JS_PROXY_TYPE: |
DCHECK(!map->is_undetectable()); |
- return kProxy; |
+ if (map->is_callable()) return kCallableProxy; |
+ return kOtherProxy; |
case MAP_TYPE: |
case ALLOCATION_SITE_TYPE: |
case ACCESSOR_INFO_TYPE: |