Index: src/ic/arm64/handler-compiler-arm64.cc |
diff --git a/src/ic/arm64/handler-compiler-arm64.cc b/src/ic/arm64/handler-compiler-arm64.cc |
index 12a2401294031980eb81acdc42289a6e27cd6f37..53519179f269d54e7d307bbc9ce2189d4320931c 100644 |
--- a/src/ic/arm64/handler-compiler-arm64.cc |
+++ b/src/ic/arm64/handler-compiler-arm64.cc |
@@ -477,6 +477,18 @@ Register PropertyHandlerCompiler::CheckPrototypes( |
if (receiver_map->IsJSGlobalObjectMap()) { |
current = isolate()->global_object(); |
} |
+ |
+ // Check access rights to the global object. This has to happen after |
+ // the map check so that we know that the object is actually a global |
+ // object. |
+ // This allows us to install generated handlers for accesses to the |
+ // global proxy (as opposed to using slow ICs). See corresponding code |
+ // in LookupForRead(). |
+ if (receiver_map->IsJSGlobalProxyMap()) { |
+ UseScratchRegisterScope temps(masm()); |
+ __ CheckAccessGlobalProxy(reg, scratch2, temps.AcquireX(), miss); |
+ } |
+ |
Handle<JSObject> prototype = Handle<JSObject>::null(); |
Handle<Map> current_map = receiver_map; |
Handle<Map> holder_map(holder()->map()); |
@@ -517,16 +529,7 @@ Register PropertyHandlerCompiler::CheckPrototypes( |
__ B(ne, miss); |
} |
- // Check access rights to the global object. This has to happen after |
- // the map check so that we know that the object is actually a global |
- // object. |
- // This allows us to install generated handlers for accesses to the |
- // global proxy (as opposed to using slow ICs). See corresponding code |
- // in LookupForRead(). |
- if (current_map->IsJSGlobalProxyMap()) { |
- UseScratchRegisterScope temps(masm()); |
- __ CheckAccessGlobalProxy(reg, scratch2, temps.AcquireX(), miss); |
- } else if (current_map->IsJSGlobalObjectMap()) { |
+ if (current_map->IsJSGlobalObjectMap()) { |
GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), |
name, scratch2, miss); |
} |
@@ -553,13 +556,6 @@ Register PropertyHandlerCompiler::CheckPrototypes( |
__ B(ne, miss); |
} |
- // Perform security check for access to the global object. |
- DCHECK(current_map->IsJSGlobalProxyMap() || |
- !current_map->is_access_check_needed()); |
- if (current_map->IsJSGlobalProxyMap()) { |
- __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss); |
- } |
- |
// Return the register containing the holder. |
return reg; |
} |