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

Side by Side Diff: src/stub-cache.cc

Issue 63513004: Merged r17459, r17462, r17474 into 3.22 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.22
Patch Set: Created 7 years, 1 month 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 | « src/stub-cache.h ('k') | src/version.cc » ('j') | 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 Handle<JSObject> receiver) { 170 Handle<JSObject> receiver) {
171 // If no global objects are present in the prototype chain, the load 171 // If no global objects are present in the prototype chain, the load
172 // nonexistent IC stub can be shared for all names for a given map 172 // nonexistent IC stub can be shared for all names for a given map
173 // and we use the empty string for the map cache in that case. If 173 // and we use the empty string for the map cache in that case. If
174 // there are global objects involved, we need to check global 174 // there are global objects involved, we need to check global
175 // property cells in the stub and therefore the stub will be 175 // property cells in the stub and therefore the stub will be
176 // specific to the name. 176 // specific to the name.
177 Handle<Name> cache_name = factory()->empty_string(); 177 Handle<Name> cache_name = factory()->empty_string();
178 Handle<JSObject> current; 178 Handle<JSObject> current;
179 Handle<Object> next = receiver; 179 Handle<Object> next = receiver;
180 Handle<GlobalObject> global; 180 Handle<JSGlobalObject> global;
181 do { 181 do {
182 current = Handle<JSObject>::cast(next); 182 current = Handle<JSObject>::cast(next);
183 next = Handle<Object>(current->GetPrototype(), isolate_); 183 next = Handle<Object>(current->GetPrototype(), isolate_);
184 if (current->IsGlobalObject()) { 184 if (current->IsJSGlobalObject()) {
185 global = Handle<GlobalObject>::cast(current); 185 global = Handle<JSGlobalObject>::cast(current);
186 cache_name = name; 186 cache_name = name;
187 } else if (!current->HasFastProperties()) { 187 } else if (!current->HasFastProperties()) {
188 cache_name = name; 188 cache_name = name;
189 } 189 }
190 } while (!next->IsNull()); 190 } while (!next->IsNull());
191 191
192 // Compile the stub that is either shared for all names or 192 // Compile the stub that is either shared for all names or
193 // name specific if there are global objects involved. 193 // name specific if there are global objects involved.
194 Handle<Code> handler = FindHandler(cache_name, receiver, Code::LOAD_IC); 194 Handle<Code> handler = FindHandler(cache_name, receiver, Code::LOAD_IC);
195 if (!handler.is_null()) return handler; 195 if (!handler.is_null()) return handler;
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 Label* success) { 1201 Label* success) {
1202 Label miss; 1202 Label miss;
1203 1203
1204 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); 1204 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss);
1205 1205
1206 HandlerFrontendFooter(name, success, &miss); 1206 HandlerFrontendFooter(name, success, &miss);
1207 return reg; 1207 return reg;
1208 } 1208 }
1209 1209
1210 1210
1211 void LoadStubCompiler::NonexistentHandlerFrontend(
1212 Handle<JSObject> object,
1213 Handle<JSObject> last,
1214 Handle<Name> name,
1215 Label* success,
1216 Handle<JSGlobalObject> global) {
1217 Label miss;
1218
1219 Register holder =
1220 HandlerFrontendHeader(object, receiver(), last, name, &miss);
1221
1222 if (!last->HasFastProperties() &&
1223 !last->IsJSGlobalObject() &&
1224 !last->IsJSGlobalProxy()) {
1225 if (!name->IsUniqueName()) {
1226 ASSERT(name->IsString());
1227 name = factory()->InternalizeString(Handle<String>::cast(name));
1228 }
1229 ASSERT(last->property_dictionary()->FindEntry(*name) ==
1230 NameDictionary::kNotFound);
1231 GenerateDictionaryNegativeLookup(masm(), &miss, holder, name,
1232 scratch2(), scratch3());
1233 }
1234
1235 // If the last object in the prototype chain is a global object,
1236 // check that the global property cell is empty.
1237 if (!global.is_null()) {
1238 GenerateCheckPropertyCell(masm(), global, name, scratch2(), &miss);
1239 }
1240
1241 HandlerFrontendFooter(name, success, &miss);
1242 }
1243
1244
1211 Handle<Code> LoadStubCompiler::CompileLoadField( 1245 Handle<Code> LoadStubCompiler::CompileLoadField(
1212 Handle<JSObject> object, 1246 Handle<JSObject> object,
1213 Handle<JSObject> holder, 1247 Handle<JSObject> holder,
1214 Handle<Name> name, 1248 Handle<Name> name,
1215 PropertyIndex field, 1249 PropertyIndex field,
1216 Representation representation) { 1250 Representation representation) {
1217 Label miss; 1251 Label miss;
1218 1252
1219 Register reg = HandlerFrontendHeader(object, receiver(), holder, name, &miss); 1253 Register reg = HandlerFrontendHeader(object, receiver(), holder, name, &miss);
1220 1254
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 Handle<FunctionTemplateInfo>( 1851 Handle<FunctionTemplateInfo>(
1818 FunctionTemplateInfo::cast(signature->receiver())); 1852 FunctionTemplateInfo::cast(signature->receiver()));
1819 } 1853 }
1820 } 1854 }
1821 1855
1822 is_simple_api_call_ = true; 1856 is_simple_api_call_ = true;
1823 } 1857 }
1824 1858
1825 1859
1826 } } // namespace v8::internal 1860 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698