Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(977)

Unified Diff: src/ic.cc

Issue 152863002: Use Type* in crankshaft rather than HeapType. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index 9e9aa933cb766c2dd77be376c45cdbd3dd192d82..fb1273941822c95429714f0e2a59b06139daf644 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -670,19 +670,28 @@ Handle<Map> IC::TypeToMap(HeapType* type, Isolate* isolate) {
}
-Handle<HeapType> IC::MapToType(Handle<Map> map) {
- Isolate* isolate = map->GetIsolate();
+template <class T>
+typename T::TypeHandle IC::MapToType(Handle<Map> map,
+ typename T::Region* region) {
if (map->instance_type() == HEAP_NUMBER_TYPE) {
- return HeapType::Number(isolate);
+ return T::Number(region);
} else if (map->instance_type() == ODDBALL_TYPE) {
// The only oddballs that can be recorded in ICs are booleans.
- return HeapType::Boolean(isolate);
+ return T::Boolean(region);
} else {
- return HeapType::Class(map, isolate);
+ return T::Class(map, region);
}
}
+template
+Type* IC::MapToType<Type>(Handle<Map> map, Zone* zone);
+
+
+template
+Handle<HeapType> IC::MapToType<HeapType>(Handle<Map> map, Isolate* region);
+
+
void IC::UpdateMonomorphicIC(Handle<HeapType> type,
Handle<Code> handler,
Handle<String> name) {
@@ -908,9 +917,11 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
// Use simple field loads for some well-known callback properties.
if (object->IsJSObject()) {
Handle<JSObject> receiver = Handle<JSObject>::cast(object);
- Handle<HeapType> type = IC::MapToType(handle(receiver->map()));
+ Handle<HeapType> type = IC::MapToType<HeapType>(
+ handle(receiver->map()), isolate());
int object_offset;
- if (Accessors::IsJSObjectFieldAccessor(type, name, &object_offset)) {
+ if (Accessors::IsJSObjectFieldAccessor<HeapType>(
+ type, name, &object_offset)) {
return SimpleFieldLoad(object_offset / kPointerSize);
}
}
@@ -1436,7 +1447,8 @@ Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver,
transitioned_receiver_map =
ComputeTransitionedMap(receiver, store_mode);
}
- if (IsTransitionOfMonomorphicTarget(MapToType(transitioned_receiver_map))) {
+ if (IsTransitionOfMonomorphicTarget(
+ MapToType<HeapType>(transitioned_receiver_map, isolate()))) {
// Element family is the same, use the "worst" case map.
store_mode = GetNonTransitioningStoreMode(store_mode);
return isolate()->stub_cache()->ComputeKeyedStoreElement(
« no previous file with comments | « src/ic.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698