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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #if V8_TARGET_ARCH_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 __ ld(a1, MemOperand(sp, (argc + 1) * kPointerSize)); 2832 __ ld(a1, MemOperand(sp, (argc + 1) * kPointerSize));
2833 // Call the target. 2833 // Call the target.
2834 __ li(a0, Operand(argc)); 2834 __ li(a0, Operand(argc));
2835 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 2835 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
2836 OperandStackDepthDecrement(argc + 1); 2836 OperandStackDepthDecrement(argc + 1);
2837 RestoreContext(); 2837 RestoreContext();
2838 // Discard the function left on TOS. 2838 // Discard the function left on TOS.
2839 context()->DropAndPlug(1, v0); 2839 context()->DropAndPlug(1, v0);
2840 } 2840 }
2841 2841
2842
2843 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) {
2844 ZoneList<Expression*>* args = expr->arguments();
2845 VisitForAccumulatorValue(args->at(0));
2846
2847 Label materialize_true, materialize_false;
2848 Label* if_true = NULL;
2849 Label* if_false = NULL;
2850 Label* fall_through = NULL;
2851 context()->PrepareTest(&materialize_true, &materialize_false,
2852 &if_true, &if_false, &fall_through);
2853
2854 __ lwu(a0, FieldMemOperand(v0, String::kHashFieldOffset));
2855 __ And(a0, a0, Operand(String::kContainsCachedArrayIndexMask));
2856
2857 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
2858 Split(eq, a0, Operand(zero_reg), if_true, if_false, fall_through);
2859
2860 context()->Plug(if_true, if_false);
2861 }
2862
2863
2864 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) {
2865 ZoneList<Expression*>* args = expr->arguments();
2866 DCHECK(args->length() == 1);
2867 VisitForAccumulatorValue(args->at(0));
2868
2869 __ AssertString(v0);
2870
2871 __ lwu(v0, FieldMemOperand(v0, String::kHashFieldOffset));
2872 __ IndexFromHash(v0, v0);
2873
2874 context()->Plug(v0);
2875 }
2876
2877
2878 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { 2842 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) {
2879 ZoneList<Expression*>* args = expr->arguments(); 2843 ZoneList<Expression*>* args = expr->arguments();
2880 DCHECK_EQ(1, args->length()); 2844 DCHECK_EQ(1, args->length());
2881 VisitForAccumulatorValue(args->at(0)); 2845 VisitForAccumulatorValue(args->at(0));
2882 __ AssertFunction(v0); 2846 __ AssertFunction(v0);
2883 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 2847 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
2884 __ ld(v0, FieldMemOperand(v0, Map::kPrototypeOffset)); 2848 __ ld(v0, FieldMemOperand(v0, Map::kPrototypeOffset));
2885 context()->Plug(v0); 2849 context()->Plug(v0);
2886 } 2850 }
2887 2851
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
3677 reinterpret_cast<uint64_t>( 3641 reinterpret_cast<uint64_t>(
3678 isolate->builtins()->OnStackReplacement()->entry())); 3642 isolate->builtins()->OnStackReplacement()->entry()));
3679 return ON_STACK_REPLACEMENT; 3643 return ON_STACK_REPLACEMENT;
3680 } 3644 }
3681 3645
3682 3646
3683 } // namespace internal 3647 } // namespace internal
3684 } // namespace v8 3648 } // namespace v8
3685 3649
3686 #endif // V8_TARGET_ARCH_MIPS64 3650 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698