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

Side by Side Diff: src/ic.cc

Issue 19006002: Flag rewriting an IC while writing to a global constant property as a failure caused by the constan… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 Object* name) { 184 Object* name) {
185 if (target->is_keyed_load_stub() || 185 if (target->is_keyed_load_stub() ||
186 target->is_keyed_call_stub() || 186 target->is_keyed_call_stub() ||
187 target->is_keyed_store_stub()) { 187 target->is_keyed_store_stub()) {
188 // Determine whether the failure is due to a name failure. 188 // Determine whether the failure is due to a name failure.
189 if (!name->IsName()) return false; 189 if (!name->IsName()) return false;
190 Name* stub_name = target->FindFirstName(); 190 Name* stub_name = target->FindFirstName();
191 if (Name::cast(name) != stub_name) return false; 191 if (Name::cast(name) != stub_name) return false;
192 } 192 }
193 193
194 if (receiver->IsGlobalObject()) {
195 if (!name->IsName()) return false;
196 Isolate* isolate = target->GetIsolate();
197 LookupResult lookup(isolate);
198 GlobalObject* global = GlobalObject::cast(receiver);
199 global->LocalLookupRealNamedProperty(Name::cast(name), &lookup);
200 if (!lookup.IsFound()) return false;
201 PropertyCell* cell = global->GetPropertyCell(&lookup);
202 return cell->type()->IsConstant();
203 }
204
194 InlineCacheHolderFlag cache_holder = 205 InlineCacheHolderFlag cache_holder =
195 Code::ExtractCacheHolderFromFlags(target->flags()); 206 Code::ExtractCacheHolderFromFlags(target->flags());
196 207
197 Isolate* isolate = target->GetIsolate(); 208 Isolate* isolate = target->GetIsolate();
198 if (cache_holder == OWN_MAP && !receiver->IsJSObject()) { 209 if (cache_holder == OWN_MAP && !receiver->IsJSObject()) {
199 // The stub was generated for JSObject but called for non-JSObject. 210 // The stub was generated for JSObject but called for non-JSObject.
200 // IC::GetCodeCacheHolder is not applicable. 211 // IC::GetCodeCacheHolder is not applicable.
201 return false; 212 return false;
202 } else if (cache_holder == PROTOTYPE_MAP && 213 } else if (cache_holder == PROTOTYPE_MAP &&
203 receiver->GetPrototype(isolate)->IsNull()) { 214 receiver->GetPrototype(isolate)->IsNull()) {
(...skipping 2873 matching lines...) Expand 10 before | Expand all | Expand 10 after
3077 #undef ADDR 3088 #undef ADDR
3078 }; 3089 };
3079 3090
3080 3091
3081 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3092 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3082 return IC_utilities[id]; 3093 return IC_utilities[id];
3083 } 3094 }
3084 3095
3085 3096
3086 } } // namespace v8::internal 3097 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698