OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // Update the inline cache and the global stub cache based on the | 309 // Update the inline cache and the global stub cache based on the |
310 // lookup result. | 310 // lookup result. |
311 void UpdateCaches(LookupResult* lookup, | 311 void UpdateCaches(LookupResult* lookup, |
312 State state, | 312 State state, |
313 Handle<Object> object, | 313 Handle<Object> object, |
314 Handle<String> name); | 314 Handle<String> name); |
315 | 315 |
316 // Stub accessors. | 316 // Stub accessors. |
317 Code* megamorphic_stub() { | 317 Code* megamorphic_stub() { |
318 return isolate()->builtins()->builtin( | 318 return isolate()->builtins()->builtin( |
319 Builtins::LoadIC_Megamorphic); | 319 Builtins::kLoadIC_Megamorphic); |
320 } | 320 } |
321 static Code* initialize_stub() { | 321 static Code* initialize_stub() { |
322 return Isolate::Current()->builtins()->builtin( | 322 return Isolate::Current()->builtins()->builtin( |
323 Builtins::LoadIC_Initialize); | 323 Builtins::kLoadIC_Initialize); |
324 } | 324 } |
325 Code* pre_monomorphic_stub() { | 325 Code* pre_monomorphic_stub() { |
326 return isolate()->builtins()->builtin( | 326 return isolate()->builtins()->builtin( |
327 Builtins::LoadIC_PreMonomorphic); | 327 Builtins::kLoadIC_PreMonomorphic); |
328 } | 328 } |
329 | 329 |
330 static void Clear(Address address, Code* target); | 330 static void Clear(Address address, Code* target); |
331 | 331 |
332 static bool PatchInlinedLoad(Address address, Object* map, int index); | 332 static bool PatchInlinedLoad(Address address, Object* map, int index); |
333 | 333 |
334 static bool PatchInlinedContextualLoad(Address address, | 334 static bool PatchInlinedContextualLoad(Address address, |
335 Object* map, | 335 Object* map, |
336 Object* cell, | 336 Object* cell, |
337 bool is_dont_delete); | 337 bool is_dont_delete); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 private: | 375 private: |
376 // Update the inline cache. | 376 // Update the inline cache. |
377 void UpdateCaches(LookupResult* lookup, | 377 void UpdateCaches(LookupResult* lookup, |
378 State state, | 378 State state, |
379 Handle<Object> object, | 379 Handle<Object> object, |
380 Handle<String> name); | 380 Handle<String> name); |
381 | 381 |
382 // Stub accessors. | 382 // Stub accessors. |
383 static Code* initialize_stub() { | 383 static Code* initialize_stub() { |
384 return Isolate::Current()->builtins()->builtin( | 384 return Isolate::Current()->builtins()->builtin( |
385 Builtins::KeyedLoadIC_Initialize); | 385 Builtins::kKeyedLoadIC_Initialize); |
386 } | 386 } |
387 Code* megamorphic_stub() { | 387 Code* megamorphic_stub() { |
388 return isolate()->builtins()->builtin( | 388 return isolate()->builtins()->builtin( |
389 Builtins::KeyedLoadIC_Generic); | 389 Builtins::kKeyedLoadIC_Generic); |
390 } | 390 } |
391 Code* generic_stub() { | 391 Code* generic_stub() { |
392 return isolate()->builtins()->builtin( | 392 return isolate()->builtins()->builtin( |
393 Builtins::KeyedLoadIC_Generic); | 393 Builtins::kKeyedLoadIC_Generic); |
394 } | 394 } |
395 Code* pre_monomorphic_stub() { | 395 Code* pre_monomorphic_stub() { |
396 return isolate()->builtins()->builtin( | 396 return isolate()->builtins()->builtin( |
397 Builtins::KeyedLoadIC_PreMonomorphic); | 397 Builtins::kKeyedLoadIC_PreMonomorphic); |
398 } | 398 } |
399 Code* string_stub() { | 399 Code* string_stub() { |
400 return isolate()->builtins()->builtin( | 400 return isolate()->builtins()->builtin( |
401 Builtins::KeyedLoadIC_String); | 401 Builtins::kKeyedLoadIC_String); |
402 } | 402 } |
403 | 403 |
404 Code* indexed_interceptor_stub() { | 404 Code* indexed_interceptor_stub() { |
405 return isolate()->builtins()->builtin( | 405 return isolate()->builtins()->builtin( |
406 Builtins::KeyedLoadIC_IndexedInterceptor); | 406 Builtins::kKeyedLoadIC_IndexedInterceptor); |
407 } | 407 } |
408 | 408 |
409 static void Clear(Address address, Code* target); | 409 static void Clear(Address address, Code* target); |
410 | 410 |
411 // Support for patching the map that is checked in an inlined | 411 // Support for patching the map that is checked in an inlined |
412 // version of keyed load. | 412 // version of keyed load. |
413 static bool PatchInlinedLoad(Address address, Object* map); | 413 static bool PatchInlinedLoad(Address address, Object* map); |
414 | 414 |
415 friend class IC; | 415 friend class IC; |
416 }; | 416 }; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 void set_target(Code* code) { | 458 void set_target(Code* code) { |
459 // Strict mode must be preserved across IC patching. | 459 // Strict mode must be preserved across IC patching. |
460 ASSERT((code->extra_ic_state() & kStrictMode) == | 460 ASSERT((code->extra_ic_state() & kStrictMode) == |
461 (target()->extra_ic_state() & kStrictMode)); | 461 (target()->extra_ic_state() & kStrictMode)); |
462 IC::set_target(code); | 462 IC::set_target(code); |
463 } | 463 } |
464 | 464 |
465 // Stub accessors. | 465 // Stub accessors. |
466 Code* megamorphic_stub() { | 466 Code* megamorphic_stub() { |
467 return isolate()->builtins()->builtin( | 467 return isolate()->builtins()->builtin( |
468 Builtins::StoreIC_Megamorphic); | 468 Builtins::kStoreIC_Megamorphic); |
469 } | 469 } |
470 Code* megamorphic_stub_strict() { | 470 Code* megamorphic_stub_strict() { |
471 return isolate()->builtins()->builtin( | 471 return isolate()->builtins()->builtin( |
472 Builtins::StoreIC_Megamorphic_Strict); | 472 Builtins::kStoreIC_Megamorphic_Strict); |
473 } | 473 } |
474 static Code* initialize_stub() { | 474 static Code* initialize_stub() { |
475 return Isolate::Current()->builtins()->builtin( | 475 return Isolate::Current()->builtins()->builtin( |
476 Builtins::StoreIC_Initialize); | 476 Builtins::kStoreIC_Initialize); |
477 } | 477 } |
478 static Code* initialize_stub_strict() { | 478 static Code* initialize_stub_strict() { |
479 return Isolate::Current()->builtins()->builtin( | 479 return Isolate::Current()->builtins()->builtin( |
480 Builtins::StoreIC_Initialize_Strict); | 480 Builtins::kStoreIC_Initialize_Strict); |
481 } | 481 } |
482 Code* global_proxy_stub() { | 482 Code* global_proxy_stub() { |
483 return isolate()->builtins()->builtin( | 483 return isolate()->builtins()->builtin( |
484 Builtins::StoreIC_GlobalProxy); | 484 Builtins::kStoreIC_GlobalProxy); |
485 } | 485 } |
486 Code* global_proxy_stub_strict() { | 486 Code* global_proxy_stub_strict() { |
487 return isolate()->builtins()->builtin( | 487 return isolate()->builtins()->builtin( |
488 Builtins::StoreIC_GlobalProxy_Strict); | 488 Builtins::kStoreIC_GlobalProxy_Strict); |
489 } | 489 } |
490 | 490 |
491 static void Clear(Address address, Code* target); | 491 static void Clear(Address address, Code* target); |
492 | 492 |
493 // Support for patching the index and the map that is checked in an | 493 // Support for patching the index and the map that is checked in an |
494 // inlined version of the named store. | 494 // inlined version of the named store. |
495 static bool PatchInlinedStore(Address address, Object* map, int index); | 495 static bool PatchInlinedStore(Address address, Object* map, int index); |
496 | 496 |
497 friend class IC; | 497 friend class IC; |
498 }; | 498 }; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 void set_target(Code* code) { | 533 void set_target(Code* code) { |
534 // Strict mode must be preserved across IC patching. | 534 // Strict mode must be preserved across IC patching. |
535 ASSERT((code->extra_ic_state() & kStrictMode) == | 535 ASSERT((code->extra_ic_state() & kStrictMode) == |
536 (target()->extra_ic_state() & kStrictMode)); | 536 (target()->extra_ic_state() & kStrictMode)); |
537 IC::set_target(code); | 537 IC::set_target(code); |
538 } | 538 } |
539 | 539 |
540 // Stub accessors. | 540 // Stub accessors. |
541 static Code* initialize_stub() { | 541 static Code* initialize_stub() { |
542 return Isolate::Current()->builtins()->builtin( | 542 return Isolate::Current()->builtins()->builtin( |
543 Builtins::KeyedStoreIC_Initialize); | 543 Builtins::kKeyedStoreIC_Initialize); |
544 } | 544 } |
545 Code* megamorphic_stub() { | 545 Code* megamorphic_stub() { |
546 return isolate()->builtins()->builtin( | 546 return isolate()->builtins()->builtin( |
547 Builtins::KeyedStoreIC_Generic); | 547 Builtins::kKeyedStoreIC_Generic); |
548 } | 548 } |
549 static Code* initialize_stub_strict() { | 549 static Code* initialize_stub_strict() { |
550 return Isolate::Current()->builtins()->builtin( | 550 return Isolate::Current()->builtins()->builtin( |
551 Builtins::KeyedStoreIC_Initialize_Strict); | 551 Builtins::kKeyedStoreIC_Initialize_Strict); |
552 } | 552 } |
553 Code* megamorphic_stub_strict() { | 553 Code* megamorphic_stub_strict() { |
554 return isolate()->builtins()->builtin( | 554 return isolate()->builtins()->builtin( |
555 Builtins::KeyedStoreIC_Generic_Strict); | 555 Builtins::kKeyedStoreIC_Generic_Strict); |
556 } | 556 } |
557 Code* generic_stub() { | 557 Code* generic_stub() { |
558 return isolate()->builtins()->builtin( | 558 return isolate()->builtins()->builtin( |
559 Builtins::KeyedStoreIC_Generic); | 559 Builtins::kKeyedStoreIC_Generic); |
560 } | 560 } |
561 Code* generic_stub_strict() { | 561 Code* generic_stub_strict() { |
562 return isolate()->builtins()->builtin( | 562 return isolate()->builtins()->builtin( |
563 Builtins::KeyedStoreIC_Generic_Strict); | 563 Builtins::kKeyedStoreIC_Generic_Strict); |
564 } | 564 } |
565 | 565 |
566 static void Clear(Address address, Code* target); | 566 static void Clear(Address address, Code* target); |
567 | 567 |
568 // Support for patching the map that is checked in an inlined | 568 // Support for patching the map that is checked in an inlined |
569 // version of keyed store. | 569 // version of keyed store. |
570 // The address is the patch point for the IC call | 570 // The address is the patch point for the IC call |
571 // (Assembler::kCallTargetAddressOffset before the end of | 571 // (Assembler::kCallTargetAddressOffset before the end of |
572 // the call/return address). | 572 // the call/return address). |
573 // The map is the new map that the inlined code should check against. | 573 // The map is the new map that the inlined code should check against. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 665 |
666 Token::Value op_; | 666 Token::Value op_; |
667 }; | 667 }; |
668 | 668 |
669 // Helper for TRBinaryOpIC and CompareIC. | 669 // Helper for TRBinaryOpIC and CompareIC. |
670 void PatchInlinedSmiCode(Address address); | 670 void PatchInlinedSmiCode(Address address); |
671 | 671 |
672 } } // namespace v8::internal | 672 } } // namespace v8::internal |
673 | 673 |
674 #endif // V8_IC_H_ | 674 #endif // V8_IC_H_ |
OLD | NEW |