Allocate fewer handles in the TypeFeedbackOracle.

R=vegorov@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7047009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7964 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 47157e8a
...@@ -81,7 +81,7 @@ bool TypeFeedbackOracle::LoadIsMonomorphic(Property* expr) { ...@@ -81,7 +81,7 @@ bool TypeFeedbackOracle::LoadIsMonomorphic(Property* expr) {
Handle<Object> map_or_code(GetInfo(expr->id())); Handle<Object> map_or_code(GetInfo(expr->id()));
if (map_or_code->IsMap()) return true; if (map_or_code->IsMap()) return true;
if (map_or_code->IsCode()) { if (map_or_code->IsCode()) {
Handle<Code> code(Code::cast(*map_or_code)); Handle<Code> code = Handle<Code>::cast(map_or_code);
return code->is_keyed_load_stub() && return code->is_keyed_load_stub() &&
code->ic_state() == MONOMORPHIC && code->ic_state() == MONOMORPHIC &&
code->FindFirstMap() != NULL; code->FindFirstMap() != NULL;
...@@ -94,7 +94,7 @@ bool TypeFeedbackOracle::StoreIsMonomorphic(Expression* expr) { ...@@ -94,7 +94,7 @@ bool TypeFeedbackOracle::StoreIsMonomorphic(Expression* expr) {
Handle<Object> map_or_code(GetInfo(expr->id())); Handle<Object> map_or_code(GetInfo(expr->id()));
if (map_or_code->IsMap()) return true; if (map_or_code->IsMap()) return true;
if (map_or_code->IsCode()) { if (map_or_code->IsCode()) {
Handle<Code> code(Code::cast(*map_or_code)); Handle<Code> code = Handle<Code>::cast(map_or_code);
return code->is_keyed_store_stub() && return code->is_keyed_store_stub() &&
code->ic_state() == MONOMORPHIC; code->ic_state() == MONOMORPHIC;
} }
...@@ -110,27 +110,25 @@ bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { ...@@ -110,27 +110,25 @@ bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) {
Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) { Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) {
ASSERT(LoadIsMonomorphic(expr)); ASSERT(LoadIsMonomorphic(expr));
Handle<Object> map_or_code( Handle<Object> map_or_code(GetInfo(expr->id()));
Handle<HeapObject>::cast(GetInfo(expr->id())));
if (map_or_code->IsCode()) { if (map_or_code->IsCode()) {
Handle<Code> code(Code::cast(*map_or_code)); Handle<Code> code = Handle<Code>::cast(map_or_code);
Map* first_map = code->FindFirstMap(); Map* first_map = code->FindFirstMap();
ASSERT(first_map != NULL); ASSERT(first_map != NULL);
return Handle<Map>(first_map); return Handle<Map>(first_map);
} }
return Handle<Map>(Map::cast(*map_or_code)); return Handle<Map>::cast(map_or_code);
} }
Handle<Map> TypeFeedbackOracle::StoreMonomorphicReceiverType(Expression* expr) { Handle<Map> TypeFeedbackOracle::StoreMonomorphicReceiverType(Expression* expr) {
ASSERT(StoreIsMonomorphic(expr)); ASSERT(StoreIsMonomorphic(expr));
Handle<HeapObject> map_or_code( Handle<Object> map_or_code(GetInfo(expr->id()));
Handle<HeapObject>::cast(GetInfo(expr->id())));
if (map_or_code->IsCode()) { if (map_or_code->IsCode()) {
Handle<Code> code(Code::cast(*map_or_code)); Handle<Code> code = Handle<Code>::cast(map_or_code);
return Handle<Map>(code->FindFirstMap()); return Handle<Map>(code->FindFirstMap());
} }
return Handle<Map>(Map::cast(*map_or_code)); return Handle<Map>::cast(map_or_code);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment