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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after
2833 __ lw(a1, MemOperand(sp, (argc + 1) * kPointerSize)); 2833 __ lw(a1, MemOperand(sp, (argc + 1) * kPointerSize));
2834 // Call the target. 2834 // Call the target.
2835 __ li(a0, Operand(argc)); 2835 __ li(a0, Operand(argc));
2836 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 2836 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
2837 OperandStackDepthDecrement(argc + 1); 2837 OperandStackDepthDecrement(argc + 1);
2838 RestoreContext(); 2838 RestoreContext();
2839 // Discard the function left on TOS. 2839 // Discard the function left on TOS.
2840 context()->DropAndPlug(1, v0); 2840 context()->DropAndPlug(1, v0);
2841 } 2841 }
2842 2842
2843
2844 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) {
2845 ZoneList<Expression*>* args = expr->arguments();
2846 VisitForAccumulatorValue(args->at(0));
2847
2848 Label materialize_true, materialize_false;
2849 Label* if_true = NULL;
2850 Label* if_false = NULL;
2851 Label* fall_through = NULL;
2852 context()->PrepareTest(&materialize_true, &materialize_false,
2853 &if_true, &if_false, &fall_through);
2854
2855 __ lw(a0, FieldMemOperand(v0, String::kHashFieldOffset));
2856 __ And(a0, a0, Operand(String::kContainsCachedArrayIndexMask));
2857
2858 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
2859 Split(eq, a0, Operand(zero_reg), if_true, if_false, fall_through);
2860
2861 context()->Plug(if_true, if_false);
2862 }
2863
2864
2865 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) {
2866 ZoneList<Expression*>* args = expr->arguments();
2867 DCHECK(args->length() == 1);
2868 VisitForAccumulatorValue(args->at(0));
2869
2870 __ AssertString(v0);
2871
2872 __ lw(v0, FieldMemOperand(v0, String::kHashFieldOffset));
2873 __ IndexFromHash(v0, v0);
2874
2875 context()->Plug(v0);
2876 }
2877
2878
2879 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { 2843 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) {
2880 ZoneList<Expression*>* args = expr->arguments(); 2844 ZoneList<Expression*>* args = expr->arguments();
2881 DCHECK_EQ(1, args->length()); 2845 DCHECK_EQ(1, args->length());
2882 VisitForAccumulatorValue(args->at(0)); 2846 VisitForAccumulatorValue(args->at(0));
2883 __ AssertFunction(v0); 2847 __ AssertFunction(v0);
2884 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 2848 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
2885 __ lw(v0, FieldMemOperand(v0, Map::kPrototypeOffset)); 2849 __ lw(v0, FieldMemOperand(v0, Map::kPrototypeOffset));
2886 context()->Plug(v0); 2850 context()->Plug(v0);
2887 } 2851 }
2888 2852
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
3670 reinterpret_cast<uint32_t>( 3634 reinterpret_cast<uint32_t>(
3671 isolate->builtins()->OnStackReplacement()->entry())); 3635 isolate->builtins()->OnStackReplacement()->entry()));
3672 return ON_STACK_REPLACEMENT; 3636 return ON_STACK_REPLACEMENT;
3673 } 3637 }
3674 3638
3675 3639
3676 } // namespace internal 3640 } // namespace internal
3677 } // namespace v8 3641 } // namespace v8
3678 3642
3679 #endif // V8_TARGET_ARCH_MIPS 3643 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698