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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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/x87/lithium-x87.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/compile-time-value.h" 8 #include "src/ast/compile-time-value.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2822 __ ldr(r1, MemOperand(sp, (argc + 1) * kPointerSize)); 2822 __ ldr(r1, MemOperand(sp, (argc + 1) * kPointerSize));
2823 // Call the target. 2823 // Call the target.
2824 __ mov(r0, Operand(argc)); 2824 __ mov(r0, Operand(argc));
2825 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 2825 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
2826 OperandStackDepthDecrement(argc + 1); 2826 OperandStackDepthDecrement(argc + 1);
2827 RestoreContext(); 2827 RestoreContext();
2828 // Discard the function left on TOS. 2828 // Discard the function left on TOS.
2829 context()->DropAndPlug(1, r0); 2829 context()->DropAndPlug(1, r0);
2830 } 2830 }
2831 2831
2832
2833 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) {
2834 ZoneList<Expression*>* args = expr->arguments();
2835 VisitForAccumulatorValue(args->at(0));
2836
2837 Label materialize_true, materialize_false;
2838 Label* if_true = NULL;
2839 Label* if_false = NULL;
2840 Label* fall_through = NULL;
2841 context()->PrepareTest(&materialize_true, &materialize_false,
2842 &if_true, &if_false, &fall_through);
2843
2844 __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset));
2845 __ tst(r0, Operand(String::kContainsCachedArrayIndexMask));
2846 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
2847 Split(eq, if_true, if_false, fall_through);
2848
2849 context()->Plug(if_true, if_false);
2850 }
2851
2852
2853 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) {
2854 ZoneList<Expression*>* args = expr->arguments();
2855 DCHECK(args->length() == 1);
2856 VisitForAccumulatorValue(args->at(0));
2857
2858 __ AssertString(r0);
2859
2860 __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset));
2861 __ IndexFromHash(r0, r0);
2862
2863 context()->Plug(r0);
2864 }
2865
2866
2867 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { 2832 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) {
2868 ZoneList<Expression*>* args = expr->arguments(); 2833 ZoneList<Expression*>* args = expr->arguments();
2869 DCHECK_EQ(1, args->length()); 2834 DCHECK_EQ(1, args->length());
2870 VisitForAccumulatorValue(args->at(0)); 2835 VisitForAccumulatorValue(args->at(0));
2871 __ AssertFunction(r0); 2836 __ AssertFunction(r0);
2872 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); 2837 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset));
2873 __ ldr(r0, FieldMemOperand(r0, Map::kPrototypeOffset)); 2838 __ ldr(r0, FieldMemOperand(r0, Map::kPrototypeOffset));
2874 context()->Plug(r0); 2839 context()->Plug(r0);
2875 } 2840 }
2876 2841
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
3726 DCHECK(interrupt_address == 3691 DCHECK(interrupt_address ==
3727 isolate->builtins()->OnStackReplacement()->entry()); 3692 isolate->builtins()->OnStackReplacement()->entry());
3728 return ON_STACK_REPLACEMENT; 3693 return ON_STACK_REPLACEMENT;
3729 } 3694 }
3730 3695
3731 3696
3732 } // namespace internal 3697 } // namespace internal
3733 } // namespace v8 3698 } // namespace v8
3734 3699
3735 #endif // V8_TARGET_ARCH_ARM 3700 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/crankshaft/x87/lithium-x87.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698