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

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

Issue 12094082: Merge KeyedLoad and NamedLoad stub compiler code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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 | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // Compile the stub that is either shared for all names or 126 // Compile the stub that is either shared for all names or
127 // name specific if there are global objects involved. 127 // name specific if there are global objects involved.
128 Code::Flags flags = 128 Code::Flags flags =
129 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::NONEXISTENT); 129 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::NONEXISTENT);
130 Handle<Object> probe(receiver->map()->FindInCodeCache(*cache_name, flags), 130 Handle<Object> probe(receiver->map()->FindInCodeCache(*cache_name, flags),
131 isolate_); 131 isolate_);
132 if (probe->IsCode()) return Handle<Code>::cast(probe); 132 if (probe->IsCode()) return Handle<Code>::cast(probe);
133 133
134 LoadStubCompiler compiler(isolate_); 134 LoadStubCompiler compiler(isolate_);
135 Handle<Code> code = 135 Handle<Code> code =
136 compiler.CompileLoadNonexistent(cache_name, receiver, current, global); 136 compiler.CompileLoadNonexistent(receiver, current, cache_name, global);
137 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *cache_name)); 137 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *cache_name));
138 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *cache_name, *code)); 138 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *cache_name, *code));
139 JSObject::UpdateMapCodeCache(receiver, cache_name, code); 139 JSObject::UpdateMapCodeCache(receiver, cache_name, code);
140 return code; 140 return code;
141 } 141 }
142 142
143 143
144 Handle<Code> StubCache::ComputeLoadField(Handle<String> name, 144 Handle<Code> StubCache::ComputeLoadField(Handle<String> name,
145 Handle<JSObject> receiver, 145 Handle<JSObject> receiver,
146 Handle<JSObject> holder, 146 Handle<JSObject> holder,
147 PropertyIndex field_index) { 147 PropertyIndex field) {
148 InlineCacheHolderFlag cache_holder = 148 InlineCacheHolderFlag cache_holder =
149 IC::GetCodeCacheForObject(*receiver, *holder); 149 IC::GetCodeCacheForObject(*receiver, *holder);
150 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); 150 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
151 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::FIELD); 151 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::FIELD);
152 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 152 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
153 isolate_); 153 isolate_);
154 if (probe->IsCode()) return Handle<Code>::cast(probe); 154 if (probe->IsCode()) return Handle<Code>::cast(probe);
155 155
156 LoadStubCompiler compiler(isolate_); 156 LoadStubCompiler compiler(isolate_);
157 Handle<Code> code = 157 Handle<Code> code = compiler.CompileLoadField(receiver, holder, name, field);
158 compiler.CompileLoadField(receiver, holder, field_index, name);
159 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 158 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
160 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 159 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
161 JSObject::UpdateMapCodeCache(map_holder, name, code); 160 JSObject::UpdateMapCodeCache(map_holder, name, code);
162 return code; 161 return code;
163 } 162 }
164 163
165 164
166 Handle<Code> StubCache::ComputeLoadCallback(Handle<String> name, 165 Handle<Code> StubCache::ComputeLoadCallback(Handle<String> name,
167 Handle<JSObject> receiver, 166 Handle<JSObject> receiver,
168 Handle<JSObject> holder, 167 Handle<JSObject> holder,
169 Handle<AccessorInfo> callback) { 168 Handle<AccessorInfo> callback) {
170 ASSERT(v8::ToCData<Address>(callback->getter()) != 0); 169 ASSERT(v8::ToCData<Address>(callback->getter()) != 0);
171 InlineCacheHolderFlag cache_holder = 170 InlineCacheHolderFlag cache_holder =
172 IC::GetCodeCacheForObject(*receiver, *holder); 171 IC::GetCodeCacheForObject(*receiver, *holder);
173 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); 172 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
174 Code::Flags flags = 173 Code::Flags flags =
175 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS); 174 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS);
176 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 175 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
177 isolate_); 176 isolate_);
178 if (probe->IsCode()) return Handle<Code>::cast(probe); 177 if (probe->IsCode()) return Handle<Code>::cast(probe);
179 178
180 LoadStubCompiler compiler(isolate_); 179 LoadStubCompiler compiler(isolate_);
181 Handle<Code> code = 180 Handle<Code> code =
182 compiler.CompileLoadCallback(name, receiver, holder, callback); 181 compiler.CompileLoadCallback(receiver, holder, name, callback);
183 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 182 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
184 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 183 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
185 JSObject::UpdateMapCodeCache(map_holder, name, code); 184 JSObject::UpdateMapCodeCache(map_holder, name, code);
186 return code; 185 return code;
187 } 186 }
188 187
189 188
190 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name, 189 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name,
191 Handle<JSObject> receiver, 190 Handle<JSObject> receiver,
192 Handle<JSObject> holder, 191 Handle<JSObject> holder,
193 Handle<JSFunction> getter) { 192 Handle<JSFunction> getter) {
194 InlineCacheHolderFlag cache_holder = 193 InlineCacheHolderFlag cache_holder =
195 IC::GetCodeCacheForObject(*receiver, *holder); 194 IC::GetCodeCacheForObject(*receiver, *holder);
196 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); 195 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
197 Code::Flags flags = 196 Code::Flags flags =
198 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS); 197 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS);
199 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 198 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
200 isolate_); 199 isolate_);
201 if (probe->IsCode()) return Handle<Code>::cast(probe); 200 if (probe->IsCode()) return Handle<Code>::cast(probe);
202 201
203 LoadStubCompiler compiler(isolate_); 202 LoadStubCompiler compiler(isolate_);
204 Handle<Code> code = 203 Handle<Code> code =
205 compiler.CompileLoadViaGetter(name, receiver, holder, getter); 204 compiler.CompileLoadViaGetter(receiver, holder, name, getter);
206 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 205 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
207 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 206 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
208 JSObject::UpdateMapCodeCache(map_holder, name, code); 207 JSObject::UpdateMapCodeCache(map_holder, name, code);
209 return code; 208 return code;
210 } 209 }
211 210
212 211
213 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name, 212 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name,
214 Handle<JSObject> receiver, 213 Handle<JSObject> receiver,
215 Handle<JSObject> holder, 214 Handle<JSObject> holder,
216 Handle<JSFunction> value) { 215 Handle<JSFunction> value) {
217 InlineCacheHolderFlag cache_holder = 216 InlineCacheHolderFlag cache_holder =
218 IC::GetCodeCacheForObject(*receiver, *holder); 217 IC::GetCodeCacheForObject(*receiver, *holder);
219 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); 218 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
220 Code::Flags flags = 219 Code::Flags flags =
221 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CONSTANT_FUNCTION); 220 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CONSTANT_FUNCTION);
222 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 221 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
223 isolate_); 222 isolate_);
224 if (probe->IsCode()) return Handle<Code>::cast(probe); 223 if (probe->IsCode()) return Handle<Code>::cast(probe);
225 224
226 LoadStubCompiler compiler(isolate_); 225 LoadStubCompiler compiler(isolate_);
227 Handle<Code> code = 226 Handle<Code> code =
228 compiler.CompileLoadConstant(receiver, holder, value, name); 227 compiler.CompileLoadConstant(receiver, holder, name, value);
229 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 228 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
230 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 229 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
231 JSObject::UpdateMapCodeCache(map_holder, name, code); 230 JSObject::UpdateMapCodeCache(map_holder, name, code);
232 return code; 231 return code;
233 } 232 }
234 233
235 234
236 Handle<Code> StubCache::ComputeLoadInterceptor(Handle<String> name, 235 Handle<Code> StubCache::ComputeLoadInterceptor(Handle<String> name,
237 Handle<JSObject> receiver, 236 Handle<JSObject> receiver,
238 Handle<JSObject> holder) { 237 Handle<JSObject> holder) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 279 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
281 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 280 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
282 JSObject::UpdateMapCodeCache(map_holder, name, code); 281 JSObject::UpdateMapCodeCache(map_holder, name, code);
283 return code; 282 return code;
284 } 283 }
285 284
286 285
287 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name, 286 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name,
288 Handle<JSObject> receiver, 287 Handle<JSObject> receiver,
289 Handle<JSObject> holder, 288 Handle<JSObject> holder,
290 PropertyIndex field_index) { 289 PropertyIndex field) {
291 InlineCacheHolderFlag cache_holder = 290 InlineCacheHolderFlag cache_holder =
292 IC::GetCodeCacheForObject(*receiver, *holder); 291 IC::GetCodeCacheForObject(*receiver, *holder);
293 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); 292 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
294 Code::Flags flags = 293 Code::Flags flags =
295 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::FIELD); 294 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::FIELD);
296 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 295 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
297 isolate_); 296 isolate_);
298 if (probe->IsCode()) return Handle<Code>::cast(probe); 297 if (probe->IsCode()) return Handle<Code>::cast(probe);
299 298
300 KeyedLoadStubCompiler compiler(isolate_); 299 KeyedLoadStubCompiler compiler(isolate_);
301 Handle<Code> code = 300 Handle<Code> code = compiler.CompileLoadField(receiver, holder, name, field);
302 compiler.CompileLoadField(name, receiver, holder, field_index);
303 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 301 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
304 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 302 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
305 JSObject::UpdateMapCodeCache(map_holder, name, code); 303 JSObject::UpdateMapCodeCache(map_holder, name, code);
306 return code; 304 return code;
307 } 305 }
308 306
309 307
310 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name, 308 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name,
311 Handle<JSObject> receiver, 309 Handle<JSObject> receiver,
312 Handle<JSObject> holder, 310 Handle<JSObject> holder,
313 Handle<JSFunction> value) { 311 Handle<JSFunction> value) {
314 InlineCacheHolderFlag cache_holder = 312 InlineCacheHolderFlag cache_holder =
315 IC::GetCodeCacheForObject(*receiver, *holder); 313 IC::GetCodeCacheForObject(*receiver, *holder);
316 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); 314 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
317 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, 315 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC,
318 Code::CONSTANT_FUNCTION); 316 Code::CONSTANT_FUNCTION);
319 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 317 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
320 isolate_); 318 isolate_);
321 if (probe->IsCode()) return Handle<Code>::cast(probe); 319 if (probe->IsCode()) return Handle<Code>::cast(probe);
322 320
323 KeyedLoadStubCompiler compiler(isolate_); 321 KeyedLoadStubCompiler compiler(isolate_);
324 Handle<Code> code = 322 Handle<Code> code =
325 compiler.CompileLoadConstant(name, receiver, holder, value); 323 compiler.CompileLoadConstant(receiver, holder, name, value);
326 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 324 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
327 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 325 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
328 JSObject::UpdateMapCodeCache(map_holder, name, code); 326 JSObject::UpdateMapCodeCache(map_holder, name, code);
329 return code; 327 return code;
330 } 328 }
331 329
332 330
333 Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<String> name, 331 Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<String> name,
334 Handle<JSObject> receiver, 332 Handle<JSObject> receiver,
335 Handle<JSObject> holder) { 333 Handle<JSObject> holder) {
(...skipping 24 matching lines...) Expand all
360 IC::GetCodeCacheForObject(*receiver, *holder); 358 IC::GetCodeCacheForObject(*receiver, *holder);
361 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); 359 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
362 Code::Flags flags = 360 Code::Flags flags =
363 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS); 361 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS);
364 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 362 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
365 isolate_); 363 isolate_);
366 if (probe->IsCode()) return Handle<Code>::cast(probe); 364 if (probe->IsCode()) return Handle<Code>::cast(probe);
367 365
368 KeyedLoadStubCompiler compiler(isolate_); 366 KeyedLoadStubCompiler compiler(isolate_);
369 Handle<Code> code = 367 Handle<Code> code =
370 compiler.CompileLoadCallback(name, receiver, holder, callback); 368 compiler.CompileLoadCallback(receiver, holder, name, callback);
371 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 369 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
372 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 370 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
373 JSObject::UpdateMapCodeCache(map_holder, name, code); 371 JSObject::UpdateMapCodeCache(map_holder, name, code);
374 return code; 372 return code;
375 } 373 }
376 374
377 375
378 Handle<Code> StubCache::ComputeStoreField(Handle<String> name, 376 Handle<Code> StubCache::ComputeStoreField(Handle<String> name,
379 Handle<JSObject> receiver, 377 Handle<JSObject> receiver,
380 int field_index, 378 int field_index,
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder, 1375 void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder,
1378 Handle<String> name, 1376 Handle<String> name,
1379 LookupResult* lookup) { 1377 LookupResult* lookup) {
1380 holder->LocalLookupRealNamedProperty(*name, lookup); 1378 holder->LocalLookupRealNamedProperty(*name, lookup);
1381 if (lookup->IsFound()) return; 1379 if (lookup->IsFound()) return;
1382 if (holder->GetPrototype()->IsNull()) return; 1380 if (holder->GetPrototype()->IsNull()) return;
1383 holder->GetPrototype()->Lookup(*name, lookup); 1381 holder->GetPrototype()->Lookup(*name, lookup);
1384 } 1382 }
1385 1383
1386 1384
1385 #define __ ACCESS_MASM(masm())
1386
1387
1388 Handle<Code> BaseLoadStubCompiler::CompileLoadField(Handle<JSObject> object,
1389 Handle<JSObject> holder,
1390 Handle<String> name,
1391 PropertyIndex index) {
1392 Label miss;
1393
1394 GenerateNameCheck(name, this->name(), &miss);
1395 GenerateLoadField(object, holder, receiver(),
1396 scratch1(), scratch2(), scratch3(),
1397 index, name, &miss);
1398 __ bind(&miss);
1399 GenerateLoadMiss(masm(), kind());
1400
1401 // Return the generated code.
1402 return GetCode(Code::FIELD, name);
1403 }
1404
1405
1406 Handle<Code> BaseLoadStubCompiler::CompileLoadCallback(
1407 Handle<JSObject> object,
1408 Handle<JSObject> holder,
1409 Handle<String> name,
1410 Handle<AccessorInfo> callback) {
1411 Label miss;
1412
1413 GenerateNameCheck(name, this->name(), &miss);
1414 GenerateLoadCallback(object, holder, receiver(), this->name(),
1415 scratch1(), scratch2(), scratch3(), scratch4(),
1416 callback, name, &miss);
1417 __ bind(&miss);
1418 GenerateLoadMiss(masm(), kind());
1419
1420 // Return the generated code.
1421 return GetCode(Code::CALLBACKS, name);
1422 }
1423
1424
1425 Handle<Code> BaseLoadStubCompiler::CompileLoadConstant(
1426 Handle<JSObject> object,
1427 Handle<JSObject> holder,
1428 Handle<String> name,
1429 Handle<JSFunction> value) {
1430 Label miss;
1431
1432 GenerateNameCheck(name, this->name(), &miss);
1433 GenerateLoadConstant(object, holder, receiver(),
1434 scratch1(), scratch2(), scratch3(),
1435 value, name, &miss);
1436 __ bind(&miss);
1437 GenerateLoadMiss(masm(), kind());
1438
1439 // Return the generated code.
1440 return GetCode(Code::CONSTANT_FUNCTION, name);
1441 }
1442
1443
1444 Handle<Code> BaseLoadStubCompiler::CompileLoadInterceptor(
1445 Handle<JSObject> object,
1446 Handle<JSObject> holder,
1447 Handle<String> name) {
1448 Label miss;
1449
1450 LookupResult lookup(isolate());
1451 LookupPostInterceptor(holder, name, &lookup);
1452
1453 GenerateNameCheck(name, this->name(), &miss);
1454 // TODO(368): Compile in the whole chain: all the interceptors in
1455 // prototypes and ultimate answer.
1456 GenerateLoadInterceptor(object, holder, &lookup, receiver(), this->name(),
1457 scratch1(), scratch2(), scratch3(),
1458 name, &miss);
1459
1460 __ bind(&miss);
1461 GenerateLoadMiss(masm(), kind());
1462
1463 // Return the generated code.
1464 return GetCode(Code::INTERCEPTOR, name);
1465 }
1466
1467
1468 #undef __
1469
1470
1387 Handle<Code> LoadStubCompiler::GetCode(Code::StubType type, 1471 Handle<Code> LoadStubCompiler::GetCode(Code::StubType type,
1388 Handle<String> name) { 1472 Handle<String> name,
1473 InlineCacheState state) {
1389 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type); 1474 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
1390 Handle<Code> code = GetCodeWithFlags(flags, name); 1475 Handle<Code> code = GetCodeWithFlags(flags, name);
1391 PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 1476 PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
1392 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 1477 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
1393 return code; 1478 return code;
1394 } 1479 }
1395 1480
1396 1481
1397 Handle<Code> KeyedLoadStubCompiler::GetCode(Code::StubType type, 1482 Handle<Code> KeyedLoadStubCompiler::GetCode(Code::StubType type,
1398 Handle<String> name, 1483 Handle<String> name,
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 Handle<FunctionTemplateInfo>( 1754 Handle<FunctionTemplateInfo>(
1670 FunctionTemplateInfo::cast(signature->receiver())); 1755 FunctionTemplateInfo::cast(signature->receiver()));
1671 } 1756 }
1672 } 1757 }
1673 1758
1674 is_simple_api_call_ = true; 1759 is_simple_api_call_ = true;
1675 } 1760 }
1676 1761
1677 1762
1678 } } // namespace v8::internal 1763 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698