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

Unified Diff: src/ic/ic-inl.h

Issue 1416493007: [turbofan] Implement the implicit ToObject for property access. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/ic.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic-inl.h
diff --git a/src/ic/ic-inl.h b/src/ic/ic-inl.h
index 0998894296ba92ed972b77f0a50e79f7d6f0f1b1..65a5a2ddec2d00c2ec4c05b2e0ee162675941510 100644
--- a/src/ic/ic-inl.h
+++ b/src/ic/ic-inl.h
@@ -127,19 +127,6 @@ Code* IC::raw_target() const {
void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); }
-JSFunction* IC::GetRootConstructor(Map* receiver_map, Context* native_context) {
- DisallowHeapAllocation no_alloc;
- if (receiver_map->IsPrimitiveMap()) {
- int constructor_function_index =
- receiver_map->GetConstructorFunctionIndex();
- if (constructor_function_index != Map::kNoConstructorFunctionIndex) {
- return JSFunction::cast(native_context->get(constructor_function_index));
- }
- }
- return nullptr;
-}
-
-
Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map,
bool receiver_is_holder, Isolate* isolate,
CacheHolderFlag* flag) {
@@ -147,9 +134,9 @@ Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map,
*flag = kCacheOnReceiver;
return receiver_map;
}
- Context* native_context = *isolate->native_context();
- JSFunction* builtin_ctor = GetRootConstructor(*receiver_map, native_context);
- if (builtin_ctor != NULL) {
+ Handle<JSFunction> builtin_ctor;
+ if (Map::GetConstructorFunction(receiver_map, isolate->native_context())
+ .ToHandle(&builtin_ctor)) {
*flag = kCacheOnPrototypeReceiverIsPrimitive;
return handle(HeapObject::cast(builtin_ctor->instance_prototype())->map());
}
@@ -163,9 +150,9 @@ Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map,
Handle<Map> IC::GetICCacheHolder(Handle<Map> map, Isolate* isolate,
CacheHolderFlag* flag) {
- Context* native_context = *isolate->native_context();
- JSFunction* builtin_ctor = GetRootConstructor(*map, native_context);
- if (builtin_ctor != NULL) {
+ Handle<JSFunction> builtin_ctor;
+ if (Map::GetConstructorFunction(map, isolate->native_context())
+ .ToHandle(&builtin_ctor)) {
*flag = kCacheOnPrototype;
return handle(builtin_ctor->initial_map());
}
« no previous file with comments | « src/ic/ic.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698