Reviewers: Sven Panne,
Message:
Trivial one... PTAL
Description:
Add unhandlified versions of Of() and NowOf().
Please review this at https://codereview.chromium.org/221813002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+13, -7 lines):
M src/types.h
M src/types.cc
M src/typing.cc
Index: src/types.cc
diff --git a/src/types.cc b/src/types.cc
index
5998fdcbad2b44283320cac9573924a3f34a209b..804ea5ece64d8a12941040014fb2300d5e59c2bd
100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -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: src/types.h
diff --git a/src/types.h b/src/types.h
index
d5e3ca4d3de458534665ac371761d1c09bb3c505..42a50b922bd0f0f56441d853687b4fd390466041
100644
--- a/src/types.h
+++ b/src/types.h
@@ -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: src/typing.cc
diff --git a/src/typing.cc b/src/typing.cc
index
dd99d197c1e755f8428fec7f7fdaf3db76137dad..3cca0f4261efb2be1962d8f77caecad16575226d
100644
--- a/src/typing.cc
+++ b/src/typing.cc
@@ -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())));
}
--
--
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/d/optout.