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

Side by Side Diff: src/crankshaft/arm64/lithium-codegen-arm64.cc

Issue 2427673004: [intrinsics] Nuke %HasCachedArrayIndex and %GetCachedArrayIndex. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « src/crankshaft/arm64/lithium-arm64.cc ('k') | src/crankshaft/hydrogen.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 __ Ldr(object, FieldMemOperand(object, HeapObject::kMapOffset)); 2652 __ Ldr(object, FieldMemOperand(object, HeapObject::kMapOffset));
2653 __ B(&use_cache); 2653 __ B(&use_cache);
2654 2654
2655 // Get the set of properties to enumerate. 2655 // Get the set of properties to enumerate.
2656 __ Bind(&call_runtime); 2656 __ Bind(&call_runtime);
2657 __ Push(object); 2657 __ Push(object);
2658 CallRuntime(Runtime::kForInEnumerate, instr); 2658 CallRuntime(Runtime::kForInEnumerate, instr);
2659 __ Bind(&use_cache); 2659 __ Bind(&use_cache);
2660 } 2660 }
2661 2661
2662
2663 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2664 Register input = ToRegister(instr->value());
2665 Register result = ToRegister(instr->result());
2666
2667 __ AssertString(input);
2668
2669 // Assert that we can use a W register load to get the hash.
2670 DCHECK((String::kHashShift + String::kArrayIndexValueBits) < kWRegSizeInBits);
2671 __ Ldr(result.W(), FieldMemOperand(input, String::kHashFieldOffset));
2672 __ IndexFromHash(result, result);
2673 }
2674
2675
2676 void LCodeGen::EmitGoto(int block) { 2662 void LCodeGen::EmitGoto(int block) {
2677 // Do not emit jump if we are emitting a goto to the next block. 2663 // Do not emit jump if we are emitting a goto to the next block.
2678 if (!IsNextEmittedBlock(block)) { 2664 if (!IsNextEmittedBlock(block)) {
2679 __ B(chunk_->GetAssemblyLabel(LookupDestination(block))); 2665 __ B(chunk_->GetAssemblyLabel(LookupDestination(block)));
2680 } 2666 }
2681 } 2667 }
2682 2668
2683
2684 void LCodeGen::DoGoto(LGoto* instr) { 2669 void LCodeGen::DoGoto(LGoto* instr) {
2685 EmitGoto(instr->block_id()); 2670 EmitGoto(instr->block_id());
2686 } 2671 }
2687 2672
2688
2689 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2690 LHasCachedArrayIndexAndBranch* instr) {
2691 Register input = ToRegister(instr->value());
2692 Register temp = ToRegister32(instr->temp());
2693
2694 // Assert that the cache status bits fit in a W register.
2695 DCHECK(is_uint32(String::kContainsCachedArrayIndexMask));
2696 __ Ldr(temp, FieldMemOperand(input, String::kHashFieldOffset));
2697 __ Tst(temp, String::kContainsCachedArrayIndexMask);
2698 EmitBranch(instr, eq);
2699 }
2700
2701
2702 // HHasInstanceTypeAndBranch instruction is built with an interval of type 2673 // HHasInstanceTypeAndBranch instruction is built with an interval of type
2703 // to test but is only used in very restricted ways. The only possible kinds 2674 // to test but is only used in very restricted ways. The only possible kinds
2704 // of intervals are: 2675 // of intervals are:
2705 // - [ FIRST_TYPE, instr->to() ] 2676 // - [ FIRST_TYPE, instr->to() ]
2706 // - [ instr->form(), LAST_TYPE ] 2677 // - [ instr->form(), LAST_TYPE ]
2707 // - instr->from() == instr->to() 2678 // - instr->from() == instr->to()
2708 // 2679 //
2709 // These kinds of intervals can be check with only one compare instruction 2680 // These kinds of intervals can be check with only one compare instruction
2710 // providing the correct value and test condition are used. 2681 // providing the correct value and test condition are used.
2711 // 2682 //
(...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after
5603 // Index is equal to negated out of object property index plus 1. 5574 // Index is equal to negated out of object property index plus 1.
5604 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5575 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5605 __ Ldr(result, FieldMemOperand(result, 5576 __ Ldr(result, FieldMemOperand(result,
5606 FixedArray::kHeaderSize - kPointerSize)); 5577 FixedArray::kHeaderSize - kPointerSize));
5607 __ Bind(deferred->exit()); 5578 __ Bind(deferred->exit());
5608 __ Bind(&done); 5579 __ Bind(&done);
5609 } 5580 }
5610 5581
5611 } // namespace internal 5582 } // namespace internal
5612 } // namespace v8 5583 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-arm64.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698