Reviewers: Toon Verwaest,

Description:
Make HConstant::InstanceOf less ambiguous.

[email protected]

Please review this at https://codereview.chromium.org/23203002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/hydrogen-instructions.h
  M src/hydrogen-instructions.cc


Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index a4c54e761e731944247005f0b940df7804617206..f7adb603c1f6e18a21be067f2ac38f3049b83fcb 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2866,7 +2866,8 @@ HCheckMaps* HCheckMaps::New(Zone* zone,
   check_map->Add(map, zone);
   if (map->CanOmitMapChecks() &&
       value->IsConstant() &&
-      HConstant::cast(value)->InstanceOf(map)) {
+      map->CanTransition() &&
+      HConstant::cast(value)->HasMap(map)) {
     check_map->omit(info);
   }
   return check_map;
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 41f9d0d5ccdecae37ed1cf08206f09136a6f8476..6b5fe21b6d7de7bba79c176f0aa6107f546693ca 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -3229,10 +3229,10 @@ class HConstant: public HTemplateInstruction<0> {
     return handle_;
   }

-  bool InstanceOf(Handle<Map> map) {
+  bool HasMap(Handle<Map> map) {
     Handle<Object> constant_object = handle();
-    return constant_object->IsJSObject() &&
-        Handle<JSObject>::cast(constant_object)->map() == *map;
+    return constant_object->IsHeapObject() &&
+        Handle<HeapObject>::cast(constant_object)->map() == *map;
   }

   bool IsSpecialDouble() const {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to