OLD | NEW |
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 2545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2556 } | 2556 } |
2557 | 2557 |
2558 | 2558 |
2559 Register* KeyedStoreStubCompiler::registers() { | 2559 Register* KeyedStoreStubCompiler::registers() { |
2560 // receiver, name, value, scratch1, scratch2, scratch3. | 2560 // receiver, name, value, scratch1, scratch2, scratch3. |
2561 static Register registers[] = { rdx, rcx, rax, rbx, rdi, r8 }; | 2561 static Register registers[] = { rdx, rcx, rax, rbx, rdi, r8 }; |
2562 return registers; | 2562 return registers; |
2563 } | 2563 } |
2564 | 2564 |
2565 | 2565 |
2566 void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name, | |
2567 Register name_reg, | |
2568 Label* miss) { | |
2569 __ Cmp(name_reg, name); | |
2570 __ j(not_equal, miss); | |
2571 } | |
2572 | |
2573 | |
2574 void KeyedStoreStubCompiler::GenerateNameCheck(Handle<Name> name, | |
2575 Register name_reg, | |
2576 Label* miss) { | |
2577 __ Cmp(name_reg, name); | |
2578 __ j(not_equal, miss); | |
2579 } | |
2580 | |
2581 | |
2582 #undef __ | 2566 #undef __ |
2583 #define __ ACCESS_MASM(masm) | 2567 #define __ ACCESS_MASM(masm) |
2584 | 2568 |
2585 | 2569 |
2586 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 2570 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
2587 Register receiver, | 2571 Register receiver, |
2588 Handle<JSFunction> getter) { | 2572 Handle<JSFunction> getter) { |
2589 // ----------- S t a t e ------------- | 2573 // ----------- S t a t e ------------- |
2590 // -- rax : receiver | 2574 // -- rax : receiver |
2591 // -- rcx : name | 2575 // -- rcx : name |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2656 | 2640 |
2657 | 2641 |
2658 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( | 2642 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( |
2659 TypeHandleList* types, | 2643 TypeHandleList* types, |
2660 CodeHandleList* handlers, | 2644 CodeHandleList* handlers, |
2661 Handle<Name> name, | 2645 Handle<Name> name, |
2662 Code::StubType type, | 2646 Code::StubType type, |
2663 IcCheckType check) { | 2647 IcCheckType check) { |
2664 Label miss; | 2648 Label miss; |
2665 | 2649 |
2666 if (check == PROPERTY) { | 2650 if (check == PROPERTY && |
2667 GenerateNameCheck(name, this->name(), &miss); | 2651 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { |
| 2652 __ Cmp(this->name(), name); |
| 2653 __ j(not_equal, &miss); |
2668 } | 2654 } |
2669 | 2655 |
2670 Label number_case; | 2656 Label number_case; |
2671 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; | 2657 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; |
2672 __ JumpIfSmi(receiver(), smi_target); | 2658 __ JumpIfSmi(receiver(), smi_target); |
2673 | 2659 |
2674 Register map_reg = scratch1(); | 2660 Register map_reg = scratch1(); |
2675 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); | 2661 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); |
2676 int receiver_count = types->length(); | 2662 int receiver_count = types->length(); |
2677 int number_of_handled_maps = 0; | 2663 int number_of_handled_maps = 0; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2745 // ----------------------------------- | 2731 // ----------------------------------- |
2746 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2732 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
2747 } | 2733 } |
2748 | 2734 |
2749 | 2735 |
2750 #undef __ | 2736 #undef __ |
2751 | 2737 |
2752 } } // namespace v8::internal | 2738 } } // namespace v8::internal |
2753 | 2739 |
2754 #endif // V8_TARGET_ARCH_X64 | 2740 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |