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

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

Issue 23578030: Reland Handle non-JSObject heap objects using slow-path IC stub guarded by the map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 3 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') | 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ASSERT(type != Code::NORMAL); 159 ASSERT(type != Code::NORMAL);
160 Code::Flags flags = Code::ComputeMonomorphicFlags( 160 Code::Flags flags = Code::ComputeMonomorphicFlags(
161 Code::STUB, extra_ic_state, type, kind); 161 Code::STUB, extra_ic_state, type, kind);
162 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags), 162 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
163 isolate_); 163 isolate_);
164 if (probe->IsCode()) return Handle<Code>::cast(probe); 164 if (probe->IsCode()) return Handle<Code>::cast(probe);
165 return Handle<Code>::null(); 165 return Handle<Code>::null();
166 } 166 }
167 167
168 168
169 Handle<Code> StubCache::ComputeMonomorphicLoadIC(Handle<JSObject> receiver, 169 Handle<Code> StubCache::ComputeMonomorphicLoadIC(Handle<HeapObject> receiver,
170 Handle<Code> handler, 170 Handle<Code> handler,
171 Handle<Name> name) { 171 Handle<Name> name) {
172 Handle<Code> ic = FindIC(name, receiver, Code::LOAD_IC, handler->type()); 172 Handle<Map> map(receiver->map());
173 Handle<Code> ic = FindIC(name, map, Code::LOAD_IC, handler->type());
173 if (!ic.is_null()) return ic; 174 if (!ic.is_null()) return ic;
174 175
175 LoadStubCompiler ic_compiler(isolate()); 176 LoadStubCompiler ic_compiler(isolate());
176 ic = ic_compiler.CompileMonomorphicIC( 177 ic = ic_compiler.CompileMonomorphicIC(map, handler, name);
177 Handle<Map>(receiver->map()), handler, name);
178 178
179 JSObject::UpdateMapCodeCache(receiver, name, ic); 179 HeapObject::UpdateMapCodeCache(receiver, name, ic);
180 return ic; 180 return ic;
181 } 181 }
182 182
183 183
184 Handle<Code> StubCache::ComputeMonomorphicKeyedLoadIC(Handle<JSObject> receiver, 184 Handle<Code> StubCache::ComputeMonomorphicKeyedLoadIC(
185 Handle<Code> handler, 185 Handle<HeapObject> receiver,
186 Handle<Name> name) { 186 Handle<Code> handler,
187 Handle<Code> ic = FindIC( 187 Handle<Name> name) {
188 name, receiver, Code::KEYED_LOAD_IC, handler->type()); 188 Handle<Map> map(receiver->map());
189 Handle<Code> ic = FindIC(name, map, Code::KEYED_LOAD_IC, handler->type());
189 if (!ic.is_null()) return ic; 190 if (!ic.is_null()) return ic;
190 191
191 KeyedLoadStubCompiler ic_compiler(isolate()); 192 KeyedLoadStubCompiler ic_compiler(isolate());
192 ic = ic_compiler.CompileMonomorphicIC( 193 ic = ic_compiler.CompileMonomorphicIC(map, handler, name);
193 Handle<Map>(receiver->map()), handler, name);
194 194
195 JSObject::UpdateMapCodeCache(receiver, name, ic); 195 HeapObject::UpdateMapCodeCache(receiver, name, ic);
196 return ic; 196 return ic;
197 } 197 }
198 198
199 199
200 Handle<Code> StubCache::ComputeMonomorphicStoreIC(Handle<JSObject> receiver, 200 Handle<Code> StubCache::ComputeMonomorphicStoreIC(Handle<HeapObject> receiver,
201 Handle<Code> handler, 201 Handle<Code> handler,
202 Handle<Name> name, 202 Handle<Name> name,
203 StrictModeFlag strict_mode) { 203 StrictModeFlag strict_mode) {
204 Handle<Map> map(receiver->map());
204 Handle<Code> ic = FindIC( 205 Handle<Code> ic = FindIC(
205 name, receiver, Code::STORE_IC, handler->type(), strict_mode); 206 name, map, Code::STORE_IC, handler->type(), strict_mode);
206 if (!ic.is_null()) return ic; 207 if (!ic.is_null()) return ic;
207 208
208 StoreStubCompiler ic_compiler(isolate(), strict_mode); 209 StoreStubCompiler ic_compiler(isolate(), strict_mode);
209 ic = ic_compiler.CompileMonomorphicIC( 210 ic = ic_compiler.CompileMonomorphicIC(map, handler, name);
210 Handle<Map>(receiver->map()), handler, name);
211 211
212 JSObject::UpdateMapCodeCache(receiver, name, ic); 212 HeapObject::UpdateMapCodeCache(receiver, name, ic);
213 return ic; 213 return ic;
214 } 214 }
215 215
216 216
217 Handle<Code> StubCache::ComputeMonomorphicKeyedStoreIC( 217 Handle<Code> StubCache::ComputeMonomorphicKeyedStoreIC(
218 Handle<JSObject> receiver, 218 Handle<HeapObject> receiver,
219 Handle<Code> handler, 219 Handle<Code> handler,
220 Handle<Name> name, 220 Handle<Name> name,
221 StrictModeFlag strict_mode) { 221 StrictModeFlag strict_mode) {
222 Handle<Map> map(receiver->map());
222 Handle<Code> ic = FindIC( 223 Handle<Code> ic = FindIC(
223 name, receiver, Code::KEYED_STORE_IC, handler->type(), strict_mode); 224 name, map, Code::KEYED_STORE_IC, handler->type(), strict_mode);
224 if (!ic.is_null()) return ic; 225 if (!ic.is_null()) return ic;
225 226
226 KeyedStoreStubCompiler ic_compiler(isolate(), strict_mode, STANDARD_STORE); 227 KeyedStoreStubCompiler ic_compiler(isolate(), strict_mode, STANDARD_STORE);
227 ic = ic_compiler.CompileMonomorphicIC( 228 ic = ic_compiler.CompileMonomorphicIC(map, handler, name);
228 Handle<Map>(receiver->map()), handler, name);
229 229
230 JSObject::UpdateMapCodeCache(receiver, name, ic); 230 HeapObject::UpdateMapCodeCache(receiver, name, ic);
231 return ic; 231 return ic;
232 } 232 }
233 233
234 234
235 Handle<Code> StubCache::ComputeLoadNonexistent(Handle<Name> name, 235 Handle<Code> StubCache::ComputeLoadNonexistent(Handle<Name> name,
236 Handle<JSObject> receiver) { 236 Handle<JSObject> receiver) {
237 // If no global objects are present in the prototype chain, the load 237 // If no global objects are present in the prototype chain, the load
238 // nonexistent IC stub can be shared for all names for a given map 238 // nonexistent IC stub can be shared for all names for a given map
239 // and we use the empty string for the map cache in that case. If 239 // and we use the empty string for the map cache in that case. If
240 // there are global objects involved, we need to check global 240 // there are global objects involved, we need to check global
(...skipping 16 matching lines...) Expand all
257 257
258 // Compile the stub that is either shared for all names or 258 // Compile the stub that is either shared for all names or
259 // name specific if there are global objects involved. 259 // name specific if there are global objects involved.
260 Handle<Code> handler = FindLoadHandler( 260 Handle<Code> handler = FindLoadHandler(
261 cache_name, receiver, receiver, Code::LOAD_IC, Code::NONEXISTENT); 261 cache_name, receiver, receiver, Code::LOAD_IC, Code::NONEXISTENT);
262 if (!handler.is_null()) return handler; 262 if (!handler.is_null()) return handler;
263 263
264 LoadStubCompiler compiler(isolate_); 264 LoadStubCompiler compiler(isolate_);
265 handler = 265 handler =
266 compiler.CompileLoadNonexistent(receiver, current, cache_name, global); 266 compiler.CompileLoadNonexistent(receiver, current, cache_name, global);
267 JSObject::UpdateMapCodeCache(receiver, cache_name, handler); 267 HeapObject::UpdateMapCodeCache(receiver, cache_name, handler);
268 return handler; 268 return handler;
269 } 269 }
270 270
271 271
272 Handle<Code> StubCache::ComputeLoadField(Handle<Name> name, 272 Handle<Code> StubCache::ComputeLoadField(Handle<Name> name,
273 Handle<JSObject> receiver, 273 Handle<JSObject> receiver,
274 Handle<JSObject> holder, 274 Handle<JSObject> holder,
275 PropertyIndex field, 275 PropertyIndex field,
276 Representation representation) { 276 Representation representation) {
277 if (receiver.is_identical_to(holder)) { 277 if (receiver.is_identical_to(holder)) {
278 LoadFieldStub stub(field.is_inobject(holder), 278 LoadFieldStub stub(field.is_inobject(holder),
279 field.translate(holder), 279 field.translate(holder),
280 representation); 280 representation);
281 return stub.GetCode(isolate()); 281 return stub.GetCode(isolate());
282 } 282 }
283 283
284 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 284 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
285 Handle<Code> stub = FindLoadHandler( 285 Handle<Code> stub = FindLoadHandler(
286 name, receiver, stub_holder, Code::LOAD_IC, Code::FIELD); 286 name, receiver, stub_holder, Code::LOAD_IC, Code::FIELD);
287 if (!stub.is_null()) return stub; 287 if (!stub.is_null()) return stub;
288 288
289 LoadStubCompiler compiler(isolate_); 289 LoadStubCompiler compiler(isolate_);
290 Handle<Code> handler = 290 Handle<Code> handler =
291 compiler.CompileLoadField(receiver, holder, name, field, representation); 291 compiler.CompileLoadField(receiver, holder, name, field, representation);
292 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 292 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
293 return handler; 293 return handler;
294 } 294 }
295 295
296 296
297 Handle<Code> StubCache::ComputeLoadCallback( 297 Handle<Code> StubCache::ComputeLoadCallback(
298 Handle<Name> name, 298 Handle<Name> name,
299 Handle<JSObject> receiver, 299 Handle<JSObject> receiver,
300 Handle<JSObject> holder, 300 Handle<JSObject> holder,
301 Handle<ExecutableAccessorInfo> callback) { 301 Handle<ExecutableAccessorInfo> callback) {
302 ASSERT(v8::ToCData<Address>(callback->getter()) != 0); 302 ASSERT(v8::ToCData<Address>(callback->getter()) != 0);
303 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 303 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
304 Handle<Code> stub = FindLoadHandler( 304 Handle<Code> stub = FindLoadHandler(
305 name, receiver, stub_holder, Code::LOAD_IC, Code::CALLBACKS); 305 name, receiver, stub_holder, Code::LOAD_IC, Code::CALLBACKS);
306 if (!stub.is_null()) return stub; 306 if (!stub.is_null()) return stub;
307 307
308 LoadStubCompiler compiler(isolate_); 308 LoadStubCompiler compiler(isolate_);
309 Handle<Code> handler = 309 Handle<Code> handler =
310 compiler.CompileLoadCallback(receiver, holder, name, callback); 310 compiler.CompileLoadCallback(receiver, holder, name, callback);
311 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 311 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
312 return handler; 312 return handler;
313 } 313 }
314 314
315 315
316 Handle<Code> StubCache::ComputeLoadCallback( 316 Handle<Code> StubCache::ComputeLoadCallback(
317 Handle<Name> name, 317 Handle<Name> name,
318 Handle<JSObject> receiver, 318 Handle<JSObject> receiver,
319 Handle<JSObject> holder, 319 Handle<JSObject> holder,
320 const CallOptimization& call_optimization) { 320 const CallOptimization& call_optimization) {
321 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 321 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
322 Handle<Code> stub = FindLoadHandler( 322 Handle<Code> stub = FindLoadHandler(
323 name, receiver, stub_holder, Code::LOAD_IC, Code::CALLBACKS); 323 name, receiver, stub_holder, Code::LOAD_IC, Code::CALLBACKS);
324 if (!stub.is_null()) return stub; 324 if (!stub.is_null()) return stub;
325 325
326 LoadStubCompiler compiler(isolate_); 326 LoadStubCompiler compiler(isolate_);
327 Handle<Code> handler = 327 Handle<Code> handler =
328 compiler.CompileLoadCallback(receiver, holder, name, call_optimization); 328 compiler.CompileLoadCallback(receiver, holder, name, call_optimization);
329 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 329 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
330 return handler; 330 return handler;
331 } 331 }
332 332
333 333
334 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<Name> name, 334 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<Name> name,
335 Handle<JSObject> receiver, 335 Handle<JSObject> receiver,
336 Handle<JSObject> holder, 336 Handle<JSObject> holder,
337 Handle<JSFunction> getter) { 337 Handle<JSFunction> getter) {
338 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 338 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
339 Handle<Code> stub = FindLoadHandler( 339 Handle<Code> stub = FindLoadHandler(
340 name, receiver, stub_holder, Code::LOAD_IC, Code::CALLBACKS); 340 name, receiver, stub_holder, Code::LOAD_IC, Code::CALLBACKS);
341 if (!stub.is_null()) return stub; 341 if (!stub.is_null()) return stub;
342 342
343 LoadStubCompiler compiler(isolate_); 343 LoadStubCompiler compiler(isolate_);
344 Handle<Code> handler = 344 Handle<Code> handler =
345 compiler.CompileLoadViaGetter(receiver, holder, name, getter); 345 compiler.CompileLoadViaGetter(receiver, holder, name, getter);
346 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 346 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
347 return handler; 347 return handler;
348 } 348 }
349 349
350 350
351 Handle<Code> StubCache::ComputeLoadConstant(Handle<Name> name, 351 Handle<Code> StubCache::ComputeLoadConstant(Handle<Name> name,
352 Handle<JSObject> receiver, 352 Handle<JSObject> receiver,
353 Handle<JSObject> holder, 353 Handle<JSObject> holder,
354 Handle<Object> value) { 354 Handle<Object> value) {
355 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 355 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
356 Handle<Code> handler = FindLoadHandler( 356 Handle<Code> handler = FindLoadHandler(
357 name, receiver, stub_holder, Code::LOAD_IC, Code::CONSTANT); 357 name, receiver, stub_holder, Code::LOAD_IC, Code::CONSTANT);
358 if (!handler.is_null()) return handler; 358 if (!handler.is_null()) return handler;
359 359
360 LoadStubCompiler compiler(isolate_); 360 LoadStubCompiler compiler(isolate_);
361 handler = compiler.CompileLoadConstant(receiver, holder, name, value); 361 handler = compiler.CompileLoadConstant(receiver, holder, name, value);
362 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 362 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
363 363
364 return handler; 364 return handler;
365 } 365 }
366 366
367 367
368 Handle<Code> StubCache::ComputeLoadInterceptor(Handle<Name> name, 368 Handle<Code> StubCache::ComputeLoadInterceptor(Handle<Name> name,
369 Handle<JSObject> receiver, 369 Handle<JSObject> receiver,
370 Handle<JSObject> holder) { 370 Handle<JSObject> holder) {
371 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 371 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
372 Handle<Code> stub = FindLoadHandler( 372 Handle<Code> stub = FindLoadHandler(
373 name, receiver, stub_holder, Code::LOAD_IC, Code::INTERCEPTOR); 373 name, receiver, stub_holder, Code::LOAD_IC, Code::INTERCEPTOR);
374 if (!stub.is_null()) return stub; 374 if (!stub.is_null()) return stub;
375 375
376 LoadStubCompiler compiler(isolate_); 376 LoadStubCompiler compiler(isolate_);
377 Handle<Code> handler = 377 Handle<Code> handler =
378 compiler.CompileLoadInterceptor(receiver, holder, name); 378 compiler.CompileLoadInterceptor(receiver, holder, name);
379 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 379 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
380 return handler; 380 return handler;
381 } 381 }
382 382
383 383
384 Handle<Code> StubCache::ComputeLoadNormal(Handle<Name> name, 384 Handle<Code> StubCache::ComputeLoadNormal(Handle<Name> name,
385 Handle<JSObject> receiver) { 385 Handle<JSObject> receiver) {
386 return isolate_->builtins()->LoadIC_Normal(); 386 return isolate_->builtins()->LoadIC_Normal();
387 } 387 }
388 388
389 389
390 Handle<Code> StubCache::ComputeLoadGlobal(Handle<Name> name, 390 Handle<Code> StubCache::ComputeLoadGlobal(Handle<Name> name,
391 Handle<JSObject> receiver, 391 Handle<JSObject> receiver,
392 Handle<GlobalObject> holder, 392 Handle<GlobalObject> holder,
393 Handle<PropertyCell> cell, 393 Handle<PropertyCell> cell,
394 bool is_dont_delete) { 394 bool is_dont_delete) {
395 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 395 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
396 Handle<Code> stub = FindIC(name, stub_holder, Code::LOAD_IC, Code::NORMAL); 396 Handle<Code> stub = FindIC(name, stub_holder, Code::LOAD_IC, Code::NORMAL);
397 if (!stub.is_null()) return stub; 397 if (!stub.is_null()) return stub;
398 398
399 LoadStubCompiler compiler(isolate_); 399 LoadStubCompiler compiler(isolate_);
400 Handle<Code> ic = 400 Handle<Code> ic =
401 compiler.CompileLoadGlobal(receiver, holder, cell, name, is_dont_delete); 401 compiler.CompileLoadGlobal(receiver, holder, cell, name, is_dont_delete);
402 JSObject::UpdateMapCodeCache(stub_holder, name, ic); 402 HeapObject::UpdateMapCodeCache(stub_holder, name, ic);
403 return ic; 403 return ic;
404 } 404 }
405 405
406 406
407 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<Name> name, 407 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<Name> name,
408 Handle<JSObject> receiver, 408 Handle<JSObject> receiver,
409 Handle<JSObject> holder, 409 Handle<JSObject> holder,
410 PropertyIndex field, 410 PropertyIndex field,
411 Representation representation) { 411 Representation representation) {
412 if (receiver.is_identical_to(holder)) { 412 if (receiver.is_identical_to(holder)) {
413 // TODO(titzer): this should use an HObjectAccess 413 // TODO(titzer): this should use an HObjectAccess
414 KeyedLoadFieldStub stub(field.is_inobject(holder), 414 KeyedLoadFieldStub stub(field.is_inobject(holder),
415 field.translate(holder), 415 field.translate(holder),
416 representation); 416 representation);
417 return stub.GetCode(isolate()); 417 return stub.GetCode(isolate());
418 } 418 }
419 419
420 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 420 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
421 Handle<Code> stub = FindLoadHandler( 421 Handle<Code> stub = FindLoadHandler(
422 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::FIELD); 422 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::FIELD);
423 if (!stub.is_null()) return stub; 423 if (!stub.is_null()) return stub;
424 424
425 KeyedLoadStubCompiler compiler(isolate_); 425 KeyedLoadStubCompiler compiler(isolate_);
426 Handle<Code> handler = 426 Handle<Code> handler =
427 compiler.CompileLoadField(receiver, holder, name, field, representation); 427 compiler.CompileLoadField(receiver, holder, name, field, representation);
428 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 428 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
429 return handler; 429 return handler;
430 } 430 }
431 431
432 432
433 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<Name> name, 433 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<Name> name,
434 Handle<JSObject> receiver, 434 Handle<JSObject> receiver,
435 Handle<JSObject> holder, 435 Handle<JSObject> holder,
436 Handle<Object> value) { 436 Handle<Object> value) {
437 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 437 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
438 Handle<Code> handler = FindLoadHandler( 438 Handle<Code> handler = FindLoadHandler(
439 name, receiver, stub_holder, Code::KEYED_LOAD_IC, 439 name, receiver, stub_holder, Code::KEYED_LOAD_IC,
440 Code::CONSTANT); 440 Code::CONSTANT);
441 if (!handler.is_null()) return handler; 441 if (!handler.is_null()) return handler;
442 442
443 KeyedLoadStubCompiler compiler(isolate_); 443 KeyedLoadStubCompiler compiler(isolate_);
444 handler = compiler.CompileLoadConstant(receiver, holder, name, value); 444 handler = compiler.CompileLoadConstant(receiver, holder, name, value);
445 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 445 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
446 return handler; 446 return handler;
447 } 447 }
448 448
449 449
450 Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<Name> name, 450 Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<Name> name,
451 Handle<JSObject> receiver, 451 Handle<JSObject> receiver,
452 Handle<JSObject> holder) { 452 Handle<JSObject> holder) {
453 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 453 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
454 Handle<Code> stub = FindLoadHandler( 454 Handle<Code> stub = FindLoadHandler(
455 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::INTERCEPTOR); 455 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::INTERCEPTOR);
456 if (!stub.is_null()) return stub; 456 if (!stub.is_null()) return stub;
457 457
458 KeyedLoadStubCompiler compiler(isolate_); 458 KeyedLoadStubCompiler compiler(isolate_);
459 Handle<Code> handler = 459 Handle<Code> handler =
460 compiler.CompileLoadInterceptor(receiver, holder, name); 460 compiler.CompileLoadInterceptor(receiver, holder, name);
461 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 461 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
462 return handler; 462 return handler;
463 } 463 }
464 464
465 465
466 Handle<Code> StubCache::ComputeKeyedLoadCallback( 466 Handle<Code> StubCache::ComputeKeyedLoadCallback(
467 Handle<Name> name, 467 Handle<Name> name,
468 Handle<JSObject> receiver, 468 Handle<JSObject> receiver,
469 Handle<JSObject> holder, 469 Handle<JSObject> holder,
470 Handle<ExecutableAccessorInfo> callback) { 470 Handle<ExecutableAccessorInfo> callback) {
471 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 471 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
472 Handle<Code> stub = FindLoadHandler( 472 Handle<Code> stub = FindLoadHandler(
473 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::CALLBACKS); 473 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::CALLBACKS);
474 if (!stub.is_null()) return stub; 474 if (!stub.is_null()) return stub;
475 475
476 KeyedLoadStubCompiler compiler(isolate_); 476 KeyedLoadStubCompiler compiler(isolate_);
477 Handle<Code> handler = 477 Handle<Code> handler =
478 compiler.CompileLoadCallback(receiver, holder, name, callback); 478 compiler.CompileLoadCallback(receiver, holder, name, callback);
479 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 479 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
480 return handler; 480 return handler;
481 } 481 }
482 482
483 483
484 Handle<Code> StubCache::ComputeKeyedLoadCallback( 484 Handle<Code> StubCache::ComputeKeyedLoadCallback(
485 Handle<Name> name, 485 Handle<Name> name,
486 Handle<JSObject> receiver, 486 Handle<JSObject> receiver,
487 Handle<JSObject> holder, 487 Handle<JSObject> holder,
488 const CallOptimization& call_optimization) { 488 const CallOptimization& call_optimization) {
489 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 489 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
490 Handle<Code> stub = FindLoadHandler( 490 Handle<Code> stub = FindLoadHandler(
491 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::CALLBACKS); 491 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::CALLBACKS);
492 if (!stub.is_null()) return stub; 492 if (!stub.is_null()) return stub;
493 493
494 KeyedLoadStubCompiler compiler(isolate_); 494 KeyedLoadStubCompiler compiler(isolate_);
495 Handle<Code> handler = 495 Handle<Code> handler =
496 compiler.CompileLoadCallback(receiver, holder, name, call_optimization); 496 compiler.CompileLoadCallback(receiver, holder, name, call_optimization);
497 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 497 HeapObject::UpdateMapCodeCache(stub_holder, name, handler);
498 return handler; 498 return handler;
499 } 499 }
500 500
501 501
502 Handle<Code> StubCache::ComputeStoreField(Handle<Name> name, 502 Handle<Code> StubCache::ComputeStoreField(Handle<Name> name,
503 Handle<JSObject> receiver, 503 Handle<JSObject> receiver,
504 LookupResult* lookup, 504 LookupResult* lookup,
505 StrictModeFlag strict_mode) { 505 StrictModeFlag strict_mode) {
506 Handle<Code> stub = FindStoreHandler( 506 Handle<Code> stub = FindStoreHandler(
507 name, receiver, Code::STORE_IC, Code::FIELD, strict_mode); 507 name, receiver, Code::STORE_IC, Code::FIELD, strict_mode);
508 if (!stub.is_null()) return stub; 508 if (!stub.is_null()) return stub;
509 509
510 StoreStubCompiler compiler(isolate_, strict_mode); 510 StoreStubCompiler compiler(isolate_, strict_mode);
511 Handle<Code> handler = compiler.CompileStoreField(receiver, lookup, name); 511 Handle<Code> handler = compiler.CompileStoreField(receiver, lookup, name);
512 JSObject::UpdateMapCodeCache(receiver, name, handler); 512 HeapObject::UpdateMapCodeCache(receiver, name, handler);
513 return handler; 513 return handler;
514 } 514 }
515 515
516 516
517 Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name, 517 Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name,
518 Handle<JSObject> receiver, 518 Handle<JSObject> receiver,
519 LookupResult* lookup, 519 LookupResult* lookup,
520 Handle<Map> transition, 520 Handle<Map> transition,
521 StrictModeFlag strict_mode) { 521 StrictModeFlag strict_mode) {
522 Handle<Code> stub = FindStoreHandler( 522 Handle<Code> stub = FindStoreHandler(
523 name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode); 523 name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode);
524 if (!stub.is_null()) return stub; 524 if (!stub.is_null()) return stub;
525 525
526 StoreStubCompiler compiler(isolate_, strict_mode); 526 StoreStubCompiler compiler(isolate_, strict_mode);
527 Handle<Code> handler = 527 Handle<Code> handler =
528 compiler.CompileStoreTransition(receiver, lookup, transition, name); 528 compiler.CompileStoreTransition(receiver, lookup, transition, name);
529 JSObject::UpdateMapCodeCache(receiver, name, handler); 529 HeapObject::UpdateMapCodeCache(receiver, name, handler);
530 return handler; 530 return handler;
531 } 531 }
532 532
533 533
534 Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) { 534 Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) {
535 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC); 535 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC);
536 Handle<Name> name = 536 Handle<Name> name =
537 isolate()->factory()->KeyedLoadElementMonomorphic_string(); 537 isolate()->factory()->KeyedLoadElementMonomorphic_string();
538 538
539 Handle<Object> probe(receiver_map->FindInCodeCache(*name, flags), isolate_); 539 Handle<Object> probe(receiver_map->FindInCodeCache(*name, flags), isolate_);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 599
600 // Replace the placeholder cell and global object map with the actual global 600 // Replace the placeholder cell and global object map with the actual global
601 // cell and receiver map. 601 // cell and receiver map.
602 Handle<Map> meta_map(isolate_->heap()->meta_map()); 602 Handle<Map> meta_map(isolate_->heap()->meta_map());
603 Handle<Object> receiver_map(receiver->map(), isolate_); 603 Handle<Object> receiver_map(receiver->map(), isolate_);
604 code = stub.GetCodeCopyFromTemplate(isolate_); 604 code = stub.GetCodeCopyFromTemplate(isolate_);
605 code->ReplaceNthObject(1, *meta_map, *receiver_map); 605 code->ReplaceNthObject(1, *meta_map, *receiver_map);
606 Handle<Map> cell_map(isolate_->heap()->global_property_cell_map()); 606 Handle<Map> cell_map(isolate_->heap()->global_property_cell_map());
607 code->ReplaceNthObject(1, *cell_map, *cell); 607 code->ReplaceNthObject(1, *cell_map, *cell);
608 608
609 JSObject::UpdateMapCodeCache(receiver, name, code); 609 HeapObject::UpdateMapCodeCache(receiver, name, code);
610 610
611 return code; 611 return code;
612 } 612 }
613 613
614 614
615 Handle<Code> StubCache::ComputeStoreCallback( 615 Handle<Code> StubCache::ComputeStoreCallback(
616 Handle<Name> name, 616 Handle<Name> name,
617 Handle<JSObject> receiver, 617 Handle<JSObject> receiver,
618 Handle<JSObject> holder, 618 Handle<JSObject> holder,
619 Handle<ExecutableAccessorInfo> callback, 619 Handle<ExecutableAccessorInfo> callback,
620 StrictModeFlag strict_mode) { 620 StrictModeFlag strict_mode) {
621 ASSERT(v8::ToCData<Address>(callback->setter()) != 0); 621 ASSERT(v8::ToCData<Address>(callback->setter()) != 0);
622 Handle<Code> stub = FindStoreHandler( 622 Handle<Code> stub = FindStoreHandler(
623 name, receiver, Code::STORE_IC, Code::CALLBACKS, strict_mode); 623 name, receiver, Code::STORE_IC, Code::CALLBACKS, strict_mode);
624 if (!stub.is_null()) return stub; 624 if (!stub.is_null()) return stub;
625 625
626 StoreStubCompiler compiler(isolate_, strict_mode); 626 StoreStubCompiler compiler(isolate_, strict_mode);
627 Handle<Code> handler = compiler.CompileStoreCallback( 627 Handle<Code> handler = compiler.CompileStoreCallback(
628 receiver, holder, name, callback); 628 receiver, holder, name, callback);
629 JSObject::UpdateMapCodeCache(receiver, name, handler); 629 HeapObject::UpdateMapCodeCache(receiver, name, handler);
630 return handler; 630 return handler;
631 } 631 }
632 632
633 633
634 Handle<Code> StubCache::ComputeStoreCallback( 634 Handle<Code> StubCache::ComputeStoreCallback(
635 Handle<Name> name, 635 Handle<Name> name,
636 Handle<JSObject> receiver, 636 Handle<JSObject> receiver,
637 Handle<JSObject> holder, 637 Handle<JSObject> holder,
638 const CallOptimization& call_optimization, 638 const CallOptimization& call_optimization,
639 StrictModeFlag strict_mode) { 639 StrictModeFlag strict_mode) {
640 Handle<Code> stub = FindStoreHandler( 640 Handle<Code> stub = FindStoreHandler(
641 name, receiver, Code::STORE_IC, Code::CALLBACKS, strict_mode); 641 name, receiver, Code::STORE_IC, Code::CALLBACKS, strict_mode);
642 if (!stub.is_null()) return stub; 642 if (!stub.is_null()) return stub;
643 643
644 StoreStubCompiler compiler(isolate_, strict_mode); 644 StoreStubCompiler compiler(isolate_, strict_mode);
645 Handle<Code> handler = compiler.CompileStoreCallback( 645 Handle<Code> handler = compiler.CompileStoreCallback(
646 receiver, holder, name, call_optimization); 646 receiver, holder, name, call_optimization);
647 JSObject::UpdateMapCodeCache(receiver, name, handler); 647 HeapObject::UpdateMapCodeCache(receiver, name, handler);
648 return handler; 648 return handler;
649 } 649 }
650 650
651 651
652 Handle<Code> StubCache::ComputeStoreViaSetter(Handle<Name> name, 652 Handle<Code> StubCache::ComputeStoreViaSetter(Handle<Name> name,
653 Handle<JSObject> receiver, 653 Handle<JSObject> receiver,
654 Handle<JSObject> holder, 654 Handle<JSObject> holder,
655 Handle<JSFunction> setter, 655 Handle<JSFunction> setter,
656 StrictModeFlag strict_mode) { 656 StrictModeFlag strict_mode) {
657 Handle<Code> stub = FindStoreHandler( 657 Handle<Code> stub = FindStoreHandler(
658 name, receiver, Code::STORE_IC, Code::CALLBACKS, strict_mode); 658 name, receiver, Code::STORE_IC, Code::CALLBACKS, strict_mode);
659 if (!stub.is_null()) return stub; 659 if (!stub.is_null()) return stub;
660 660
661 StoreStubCompiler compiler(isolate_, strict_mode); 661 StoreStubCompiler compiler(isolate_, strict_mode);
662 Handle<Code> handler = compiler.CompileStoreViaSetter( 662 Handle<Code> handler = compiler.CompileStoreViaSetter(
663 receiver, holder, name, setter); 663 receiver, holder, name, setter);
664 JSObject::UpdateMapCodeCache(receiver, name, handler); 664 HeapObject::UpdateMapCodeCache(receiver, name, handler);
665 return handler; 665 return handler;
666 } 666 }
667 667
668 668
669 Handle<Code> StubCache::ComputeStoreInterceptor(Handle<Name> name, 669 Handle<Code> StubCache::ComputeStoreInterceptor(Handle<Name> name,
670 Handle<JSObject> receiver, 670 Handle<JSObject> receiver,
671 StrictModeFlag strict_mode) { 671 StrictModeFlag strict_mode) {
672 Handle<Code> stub = FindStoreHandler( 672 Handle<Code> stub = FindStoreHandler(
673 name, receiver, Code::STORE_IC, Code::INTERCEPTOR, strict_mode); 673 name, receiver, Code::STORE_IC, Code::INTERCEPTOR, strict_mode);
674 if (!stub.is_null()) return stub; 674 if (!stub.is_null()) return stub;
675 675
676 StoreStubCompiler compiler(isolate_, strict_mode); 676 StoreStubCompiler compiler(isolate_, strict_mode);
677 Handle<Code> handler = compiler.CompileStoreInterceptor(receiver, name); 677 Handle<Code> handler = compiler.CompileStoreInterceptor(receiver, name);
678 JSObject::UpdateMapCodeCache(receiver, name, handler); 678 HeapObject::UpdateMapCodeCache(receiver, name, handler);
679 return handler; 679 return handler;
680 } 680 }
681 681
682 682
683 Handle<Code> StubCache::ComputeKeyedStoreField(Handle<Name> name, 683 Handle<Code> StubCache::ComputeKeyedStoreField(Handle<Name> name,
684 Handle<JSObject> receiver, 684 Handle<JSObject> receiver,
685 LookupResult* lookup, 685 LookupResult* lookup,
686 StrictModeFlag strict_mode) { 686 StrictModeFlag strict_mode) {
687 Handle<Code> stub = FindStoreHandler( 687 Handle<Code> stub = FindStoreHandler(
688 name, receiver, Code::KEYED_STORE_IC, Code::FIELD, strict_mode); 688 name, receiver, Code::KEYED_STORE_IC, Code::FIELD, strict_mode);
689 if (!stub.is_null()) return stub; 689 if (!stub.is_null()) return stub;
690 690
691 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE); 691 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE);
692 Handle<Code> handler = compiler.CompileStoreField(receiver, lookup, name); 692 Handle<Code> handler = compiler.CompileStoreField(receiver, lookup, name);
693 JSObject::UpdateMapCodeCache(receiver, name, handler); 693 HeapObject::UpdateMapCodeCache(receiver, name, handler);
694 return handler; 694 return handler;
695 } 695 }
696 696
697 697
698 Handle<Code> StubCache::ComputeKeyedStoreTransition( 698 Handle<Code> StubCache::ComputeKeyedStoreTransition(
699 Handle<Name> name, 699 Handle<Name> name,
700 Handle<JSObject> receiver, 700 Handle<JSObject> receiver,
701 LookupResult* lookup, 701 LookupResult* lookup,
702 Handle<Map> transition, 702 Handle<Map> transition,
703 StrictModeFlag strict_mode) { 703 StrictModeFlag strict_mode) {
704 Handle<Code> stub = FindStoreHandler( 704 Handle<Code> stub = FindStoreHandler(
705 name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode); 705 name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode);
706 if (!stub.is_null()) return stub; 706 if (!stub.is_null()) return stub;
707 707
708 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE); 708 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE);
709 Handle<Code> handler = 709 Handle<Code> handler =
710 compiler.CompileStoreTransition(receiver, lookup, transition, name); 710 compiler.CompileStoreTransition(receiver, lookup, transition, name);
711 JSObject::UpdateMapCodeCache(receiver, name, handler); 711 HeapObject::UpdateMapCodeCache(receiver, name, handler);
712 return handler; 712 return handler;
713 } 713 }
714 714
715 715
716 #define CALL_LOGGER_TAG(kind, type) \ 716 #define CALL_LOGGER_TAG(kind, type) \
717 (kind == Code::CALL_IC ? Logger::type : Logger::KEYED_##type) 717 (kind == Code::CALL_IC ? Logger::type : Logger::KEYED_##type)
718 718
719 Handle<Code> StubCache::ComputeCallConstant(int argc, 719 Handle<Code> StubCache::ComputeCallConstant(int argc,
720 Code::Kind kind, 720 Code::Kind kind,
721 Code::ExtraICState extra_state, 721 Code::ExtraICState extra_state,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); 758 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder);
759 Handle<Code> code = 759 Handle<Code> code =
760 compiler.CompileCallConstant(object, holder, name, check, function); 760 compiler.CompileCallConstant(object, holder, name, check, function);
761 code->set_check_type(check); 761 code->set_check_type(check);
762 ASSERT(flags == code->flags()); 762 ASSERT(flags == code->flags());
763 PROFILE(isolate_, 763 PROFILE(isolate_,
764 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); 764 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
765 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); 765 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
766 766
767 if (CallStubCompiler::CanBeCached(function)) { 767 if (CallStubCompiler::CanBeCached(function)) {
768 JSObject::UpdateMapCodeCache(stub_holder, name, code); 768 HeapObject::UpdateMapCodeCache(stub_holder, name, code);
769 } 769 }
770 return code; 770 return code;
771 } 771 }
772 772
773 773
774 Handle<Code> StubCache::ComputeCallField(int argc, 774 Handle<Code> StubCache::ComputeCallField(int argc,
775 Code::Kind kind, 775 Code::Kind kind,
776 Code::ExtraICState extra_state, 776 Code::ExtraICState extra_state,
777 Handle<Name> name, 777 Handle<Name> name,
778 Handle<Object> object, 778 Handle<Object> object,
(...skipping 20 matching lines...) Expand all
799 if (probe->IsCode()) return Handle<Code>::cast(probe); 799 if (probe->IsCode()) return Handle<Code>::cast(probe);
800 800
801 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); 801 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder);
802 Handle<Code> code = 802 Handle<Code> code =
803 compiler.CompileCallField(Handle<JSObject>::cast(object), 803 compiler.CompileCallField(Handle<JSObject>::cast(object),
804 holder, index, name); 804 holder, index, name);
805 ASSERT(flags == code->flags()); 805 ASSERT(flags == code->flags());
806 PROFILE(isolate_, 806 PROFILE(isolate_,
807 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); 807 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
808 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); 808 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
809 JSObject::UpdateMapCodeCache(stub_holder, name, code); 809 HeapObject::UpdateMapCodeCache(stub_holder, name, code);
810 return code; 810 return code;
811 } 811 }
812 812
813 813
814 Handle<Code> StubCache::ComputeCallInterceptor(int argc, 814 Handle<Code> StubCache::ComputeCallInterceptor(int argc,
815 Code::Kind kind, 815 Code::Kind kind,
816 Code::ExtraICState extra_state, 816 Code::ExtraICState extra_state,
817 Handle<Name> name, 817 Handle<Name> name,
818 Handle<Object> object, 818 Handle<Object> object,
819 Handle<JSObject> holder) { 819 Handle<JSObject> holder) {
(...skipping 18 matching lines...) Expand all
838 if (probe->IsCode()) return Handle<Code>::cast(probe); 838 if (probe->IsCode()) return Handle<Code>::cast(probe);
839 839
840 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); 840 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder);
841 Handle<Code> code = 841 Handle<Code> code =
842 compiler.CompileCallInterceptor(Handle<JSObject>::cast(object), 842 compiler.CompileCallInterceptor(Handle<JSObject>::cast(object),
843 holder, name); 843 holder, name);
844 ASSERT(flags == code->flags()); 844 ASSERT(flags == code->flags());
845 PROFILE(isolate(), 845 PROFILE(isolate(),
846 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); 846 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
847 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); 847 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
848 JSObject::UpdateMapCodeCache(stub_holder, name, code); 848 HeapObject::UpdateMapCodeCache(stub_holder, name, code);
849 return code; 849 return code;
850 } 850 }
851 851
852 852
853 Handle<Code> StubCache::ComputeCallGlobal(int argc, 853 Handle<Code> StubCache::ComputeCallGlobal(int argc,
854 Code::Kind kind, 854 Code::Kind kind,
855 Code::ExtraICState extra_state, 855 Code::ExtraICState extra_state,
856 Handle<Name> name, 856 Handle<Name> name,
857 Handle<JSObject> receiver, 857 Handle<JSObject> receiver,
858 Handle<GlobalObject> holder, 858 Handle<GlobalObject> holder,
(...skipping 10 matching lines...) Expand all
869 if (probe->IsCode()) return Handle<Code>::cast(probe); 869 if (probe->IsCode()) return Handle<Code>::cast(probe);
870 870
871 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); 871 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder);
872 Handle<Code> code = 872 Handle<Code> code =
873 compiler.CompileCallGlobal(receiver, holder, cell, function, name); 873 compiler.CompileCallGlobal(receiver, holder, cell, function, name);
874 ASSERT(flags == code->flags()); 874 ASSERT(flags == code->flags());
875 PROFILE(isolate(), 875 PROFILE(isolate(),
876 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); 876 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
877 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); 877 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
878 if (CallStubCompiler::CanBeCached(function)) { 878 if (CallStubCompiler::CanBeCached(function)) {
879 JSObject::UpdateMapCodeCache(stub_holder, name, code); 879 HeapObject::UpdateMapCodeCache(stub_holder, name, code);
880 } 880 }
881 return code; 881 return code;
882 } 882 }
883 883
884 884
885 static void FillCache(Isolate* isolate, Handle<Code> code) { 885 static void FillCache(Isolate* isolate, Handle<Code> code) {
886 Handle<UnseededNumberDictionary> dictionary = 886 Handle<UnseededNumberDictionary> dictionary =
887 UnseededNumberDictionary::Set(isolate->factory()->non_monomorphic_cache(), 887 UnseededNumberDictionary::Set(isolate->factory()->non_monomorphic_cache(),
888 code->flags(), 888 code->flags(),
889 code); 889 code);
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2252 Handle<FunctionTemplateInfo>( 2252 Handle<FunctionTemplateInfo>(
2253 FunctionTemplateInfo::cast(signature->receiver())); 2253 FunctionTemplateInfo::cast(signature->receiver()));
2254 } 2254 }
2255 } 2255 }
2256 2256
2257 is_simple_api_call_ = true; 2257 is_simple_api_call_ = true;
2258 } 2258 }
2259 2259
2260 2260
2261 } } // namespace v8::internal 2261 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698