OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 Handle<Object> object, | 276 Handle<Object> object, |
277 Handle<Object> key); | 277 Handle<Object> key); |
278 | 278 |
279 // Code generator routines. | 279 // Code generator routines. |
280 static void GenerateInitialize(MacroAssembler* masm, int argc) { | 280 static void GenerateInitialize(MacroAssembler* masm, int argc) { |
281 GenerateMiss(masm, argc); | 281 GenerateMiss(masm, argc); |
282 } | 282 } |
283 static void GenerateMiss(MacroAssembler* masm, int argc); | 283 static void GenerateMiss(MacroAssembler* masm, int argc); |
284 static void GenerateMegamorphic(MacroAssembler* masm, int argc); | 284 static void GenerateMegamorphic(MacroAssembler* masm, int argc); |
285 static void GenerateNormal(MacroAssembler* masm, int argc); | 285 static void GenerateNormal(MacroAssembler* masm, int argc); |
| 286 static void GenerateNonStrictArguments(MacroAssembler* masm, int argc); |
286 }; | 287 }; |
287 | 288 |
288 | 289 |
289 class LoadIC: public IC { | 290 class LoadIC: public IC { |
290 public: | 291 public: |
291 explicit LoadIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { | 292 explicit LoadIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
292 ASSERT(target()->is_load_stub()); | 293 ASSERT(target()->is_load_stub()); |
293 } | 294 } |
294 | 295 |
295 MUST_USE_RESULT MaybeObject* Load(State state, | 296 MUST_USE_RESULT MaybeObject* Load(State state, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 static void GenerateMiss(MacroAssembler* masm, bool force_generic); | 402 static void GenerateMiss(MacroAssembler* masm, bool force_generic); |
402 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 403 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
403 static void GenerateInitialize(MacroAssembler* masm) { | 404 static void GenerateInitialize(MacroAssembler* masm) { |
404 GenerateMiss(masm, false); | 405 GenerateMiss(masm, false); |
405 } | 406 } |
406 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 407 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
407 GenerateMiss(masm, false); | 408 GenerateMiss(masm, false); |
408 } | 409 } |
409 static void GenerateGeneric(MacroAssembler* masm); | 410 static void GenerateGeneric(MacroAssembler* masm); |
410 static void GenerateString(MacroAssembler* masm); | 411 static void GenerateString(MacroAssembler* masm); |
411 | |
412 static void GenerateIndexedInterceptor(MacroAssembler* masm); | 412 static void GenerateIndexedInterceptor(MacroAssembler* masm); |
| 413 static void GenerateNonStrictArguments(MacroAssembler* masm); |
413 | 414 |
414 // Bit mask to be tested against bit field for the cases when | 415 // Bit mask to be tested against bit field for the cases when |
415 // generic stub should go into slow case. | 416 // generic stub should go into slow case. |
416 // Access check is necessary explicitly since generic stub does not perform | 417 // Access check is necessary explicitly since generic stub does not perform |
417 // map checks. | 418 // map checks. |
418 static const int kSlowCaseBitFieldMask = | 419 static const int kSlowCaseBitFieldMask = |
419 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); | 420 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
420 | 421 |
421 virtual MaybeObject* GetFastElementStubWithoutMapCheck( | 422 virtual MaybeObject* GetFastElementStubWithoutMapCheck( |
422 bool is_js_array); | 423 bool is_js_array); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 Builtins::kKeyedLoadIC_Generic); | 461 Builtins::kKeyedLoadIC_Generic); |
461 } | 462 } |
462 Code* pre_monomorphic_stub() { | 463 Code* pre_monomorphic_stub() { |
463 return isolate()->builtins()->builtin( | 464 return isolate()->builtins()->builtin( |
464 Builtins::kKeyedLoadIC_PreMonomorphic); | 465 Builtins::kKeyedLoadIC_PreMonomorphic); |
465 } | 466 } |
466 Code* indexed_interceptor_stub() { | 467 Code* indexed_interceptor_stub() { |
467 return isolate()->builtins()->builtin( | 468 return isolate()->builtins()->builtin( |
468 Builtins::kKeyedLoadIC_IndexedInterceptor); | 469 Builtins::kKeyedLoadIC_IndexedInterceptor); |
469 } | 470 } |
| 471 Code* non_strict_arguments_stub() { |
| 472 return isolate()->builtins()->builtin( |
| 473 Builtins::kKeyedLoadIC_NonStrictArguments); |
| 474 } |
470 | 475 |
471 static void Clear(Address address, Code* target); | 476 static void Clear(Address address, Code* target); |
472 | 477 |
473 friend class IC; | 478 friend class IC; |
474 }; | 479 }; |
475 | 480 |
476 | 481 |
477 class StoreIC: public IC { | 482 class StoreIC: public IC { |
478 public: | 483 public: |
479 explicit StoreIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { | 484 explicit StoreIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 565 |
561 // Code generators for stub routines. Only called once at startup. | 566 // Code generators for stub routines. Only called once at startup. |
562 static void GenerateInitialize(MacroAssembler* masm) { | 567 static void GenerateInitialize(MacroAssembler* masm) { |
563 GenerateMiss(masm, false); | 568 GenerateMiss(masm, false); |
564 } | 569 } |
565 static void GenerateMiss(MacroAssembler* masm, bool force_generic); | 570 static void GenerateMiss(MacroAssembler* masm, bool force_generic); |
566 static void GenerateSlow(MacroAssembler* masm); | 571 static void GenerateSlow(MacroAssembler* masm); |
567 static void GenerateRuntimeSetProperty(MacroAssembler* masm, | 572 static void GenerateRuntimeSetProperty(MacroAssembler* masm, |
568 StrictModeFlag strict_mode); | 573 StrictModeFlag strict_mode); |
569 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); | 574 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); |
| 575 static void GenerateNonStrictArguments(MacroAssembler* masm); |
570 | 576 |
571 virtual MaybeObject* GetFastElementStubWithoutMapCheck( | 577 virtual MaybeObject* GetFastElementStubWithoutMapCheck( |
572 bool is_js_array); | 578 bool is_js_array); |
573 | 579 |
574 virtual MaybeObject* GetExternalArrayStubWithoutMapCheck( | 580 virtual MaybeObject* GetExternalArrayStubWithoutMapCheck( |
575 JSObject::ElementsKind elements_kind); | 581 JSObject::ElementsKind elements_kind); |
576 | 582 |
577 protected: | 583 protected: |
578 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } | 584 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } |
579 | 585 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 Builtins::kKeyedStoreIC_Generic_Strict); | 624 Builtins::kKeyedStoreIC_Generic_Strict); |
619 } | 625 } |
620 Code* generic_stub() { | 626 Code* generic_stub() { |
621 return isolate()->builtins()->builtin( | 627 return isolate()->builtins()->builtin( |
622 Builtins::kKeyedStoreIC_Generic); | 628 Builtins::kKeyedStoreIC_Generic); |
623 } | 629 } |
624 Code* generic_stub_strict() { | 630 Code* generic_stub_strict() { |
625 return isolate()->builtins()->builtin( | 631 return isolate()->builtins()->builtin( |
626 Builtins::kKeyedStoreIC_Generic_Strict); | 632 Builtins::kKeyedStoreIC_Generic_Strict); |
627 } | 633 } |
| 634 Code* non_strict_arguments_stub() { |
| 635 return isolate()->builtins()->builtin( |
| 636 Builtins::kKeyedStoreIC_NonStrictArguments); |
| 637 } |
628 | 638 |
629 static void Clear(Address address, Code* target); | 639 static void Clear(Address address, Code* target); |
630 | 640 |
631 friend class IC; | 641 friend class IC; |
632 }; | 642 }; |
633 | 643 |
634 | 644 |
635 class UnaryOpIC: public IC { | 645 class UnaryOpIC: public IC { |
636 public: | 646 public: |
637 // sorted: increasingly more unspecific (ignoring UNINITIALIZED) | 647 // sorted: increasingly more unspecific (ignoring UNINITIALIZED) |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 734 |
725 Token::Value op_; | 735 Token::Value op_; |
726 }; | 736 }; |
727 | 737 |
728 // Helper for BinaryOpIC and CompareIC. | 738 // Helper for BinaryOpIC and CompareIC. |
729 void PatchInlinedSmiCode(Address address); | 739 void PatchInlinedSmiCode(Address address); |
730 | 740 |
731 } } // namespace v8::internal | 741 } } // namespace v8::internal |
732 | 742 |
733 #endif // V8_IC_H_ | 743 #endif // V8_IC_H_ |
OLD | NEW |