Add unhandlified versions of Of() and NowOf().
authorbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 2 Apr 2014 07:01:43 +0000 (07:01 +0000)
committerbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 2 Apr 2014 07:01:43 +0000 (07:01 +0000)
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/221813002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20423 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/types.cc
src/types.h
src/typing.cc

index 5998fdc..804ea5e 100644 (file)
@@ -249,13 +249,13 @@ int TypeImpl<Config>::GlbBitset() {
 // Most precise _current_ type of a value (usually its class).
 template<class Config>
 typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::NowOf(
-    i::Handle<i::Object> value, Region* region) {
+    i::Object* value, Region* region) {
   if (value->IsSmi() ||
-      i::HeapObject::cast(*value)->map()->instance_type() == HEAP_NUMBER_TYPE ||
-      i::HeapObject::cast(*value)->map()->instance_type() == ODDBALL_TYPE) {
+      i::HeapObject::cast(value)->map()->instance_type() == HEAP_NUMBER_TYPE ||
+      i::HeapObject::cast(value)->map()->instance_type() == ODDBALL_TYPE) {
     return Of(value, region);
   }
-  return Class(i::handle(i::HeapObject::cast(*value)->map()), region);
+  return Class(i::handle(i::HeapObject::cast(value)->map()), region);
 }
 
 
index d5e3ca4..42a50b9 100644 (file)
@@ -213,8 +213,11 @@ class TypeImpl : public Config::Base {
   static TypeHandle Union(TypeHandle type1, TypeHandle type2, Region* reg);
   static TypeHandle Intersect(TypeHandle type1, TypeHandle type2, Region* reg);
 
+  static TypeHandle Of(i::Object* value, Region* region) {
+    return Config::from_bitset(LubBitset(value), region);
+  }
   static TypeHandle Of(i::Handle<i::Object> value, Region* region) {
-    return Config::from_bitset(LubBitset(*value), region);
+    return Of(*value, region);
   }
 
   bool Is(TypeImpl* that) { return this == that || this->SlowIs(that); }
@@ -231,7 +234,10 @@ class TypeImpl : public Config::Base {
 
   // State-dependent versions of Of and Is that consider subtyping between
   // a constant and its map class.
-  static TypeHandle NowOf(i::Handle<i::Object> value, Region* region);
+  static TypeHandle NowOf(i::Object* value, Region* region);
+  static TypeHandle NowOf(i::Handle<i::Object> value, Region* region) {
+    return NowOf(*value, region);
+  }
   bool NowIs(TypeImpl* that);
   template<class TypeHandle>
   bool NowIs(TypeHandle that)  { return this->NowIs(*that); }
index dd99d19..3cca0f4 100644 (file)
@@ -83,7 +83,7 @@ void AstTyper::Run(CompilationInfo* info) {
 
 
 Effect AstTyper::ObservedOnStack(Object* value) {
-  Type* lower = Type::NowOf(handle(value, isolate()), zone());
+  Type* lower = Type::NowOf(value, zone());
   return Effect(Bounds(lower, Type::Any(zone())));
 }