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

Side by Side Diff: src/a64/code-stubs-a64.cc

Issue 148883002: Synchronize with r15594. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « samples/shell.cc ('k') | src/a64/ic-a64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 // -- x2 : name 2890 // -- x2 : name
2891 // -- x0 : receiver 2891 // -- x0 : receiver
2892 // -- sp[0] : receiver 2892 // -- sp[0] : receiver
2893 // ----------------------------------- 2893 // -----------------------------------
2894 receiver = x0; 2894 receiver = x0;
2895 } 2895 }
2896 2896
2897 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, x11, &miss); 2897 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, x11, &miss);
2898 2898
2899 __ Bind(&miss); 2899 __ Bind(&miss);
2900 StubCompiler::TailCallBuiltin(masm, StubCompiler::MissBuiltin(kind())); 2900 StubCompiler::TailCallBuiltin(masm,
2901 BaseLoadStoreStubCompiler::MissBuiltin(kind()));
2901 } 2902 }
2902 2903
2903 2904
2904 void StringLengthStub::Generate(MacroAssembler* masm) { 2905 void StringLengthStub::Generate(MacroAssembler* masm) {
2905 Label miss; 2906 Label miss;
2906 Register receiver; 2907 Register receiver;
2907 if (kind() == Code::KEYED_LOAD_IC) { 2908 if (kind() == Code::KEYED_LOAD_IC) {
2908 // ----------- S t a t e ------------- 2909 // ----------- S t a t e -------------
2909 // -- lr : return address 2910 // -- lr : return address
2910 // -- x1 : receiver 2911 // -- x1 : receiver
(...skipping 11 matching lines...) Expand all
2922 // -- x0 : receiver 2923 // -- x0 : receiver
2923 // -- sp[0] : receiver 2924 // -- sp[0] : receiver
2924 // ----------------------------------- 2925 // -----------------------------------
2925 receiver = x0; 2926 receiver = x0;
2926 } 2927 }
2927 2928
2928 StubCompiler::GenerateLoadStringLength(masm, receiver, x10, x11, &miss, 2929 StubCompiler::GenerateLoadStringLength(masm, receiver, x10, x11, &miss,
2929 support_wrapper_); 2930 support_wrapper_);
2930 2931
2931 __ Bind(&miss); 2932 __ Bind(&miss);
2932 StubCompiler::TailCallBuiltin(masm, StubCompiler::MissBuiltin(kind())); 2933 StubCompiler::TailCallBuiltin(masm,
2934 BaseLoadStoreStubCompiler::MissBuiltin(kind()));
2933 } 2935 }
2934 2936
2935 2937
2936 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { 2938 void StoreArrayLengthStub::Generate(MacroAssembler* masm) {
2937 ASM_LOCATION("StoreArrayLengthStub::Generate"); 2939 ASM_LOCATION("StoreArrayLengthStub::Generate");
2938 // This accepts as a receiver anything JSArray::SetElementsLength accepts 2940 // This accepts as a receiver anything JSArray::SetElementsLength accepts
2939 // (currently anything except for external arrays which means anything with 2941 // (currently anything except for external arrays which means anything with
2940 // elements of FixedArray type). Value must be a number, but only smis are 2942 // elements of FixedArray type). Value must be a number, but only smis are
2941 // accepted as the most common case. 2943 // accepted as the most common case.
2942 Label miss; 2944 Label miss;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2992 __ JumpIfNotSmi(value, &miss); 2994 __ JumpIfNotSmi(value, &miss);
2993 2995
2994 // Prepare tail call to StoreIC_ArrayLength. 2996 // Prepare tail call to StoreIC_ArrayLength.
2995 __ Push(receiver, value); 2997 __ Push(receiver, value);
2996 2998
2997 ExternalReference ref = 2999 ExternalReference ref =
2998 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), masm->isolate()); 3000 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), masm->isolate());
2999 __ TailCallExternalReference(ref, 2, 1); 3001 __ TailCallExternalReference(ref, 2, 1);
3000 3002
3001 __ Bind(&miss); 3003 __ Bind(&miss);
3002 StubCompiler::TailCallBuiltin(masm, StubCompiler::MissBuiltin(kind())); 3004 StubCompiler::TailCallBuiltin(masm,
3005 BaseLoadStoreStubCompiler::MissBuiltin(kind()));
3003 } 3006 }
3004 3007
3005 3008
3006 void InstanceofStub::Generate(MacroAssembler* masm) { 3009 void InstanceofStub::Generate(MacroAssembler* masm) {
3007 // Stack on entry: 3010 // Stack on entry:
3008 // jssp[0]: function. 3011 // jssp[0]: function.
3009 // jssp[8]: object. 3012 // jssp[8]: object.
3010 // 3013 //
3011 // Returns result in x0. Zero indicates instanceof, smi 1 indicates not 3014 // Returns result in x0. Zero indicates instanceof, smi 1 indicates not
3012 // instanceof. 3015 // instanceof.
(...skipping 3796 matching lines...) Expand 10 before | Expand all | Expand 10 after
6809 &normal_sequence); 6812 &normal_sequence);
6810 6813
6811 __ Ldr(x10, FieldMemOperand(type_info_cell, Cell::kValueOffset)); 6814 __ Ldr(x10, FieldMemOperand(type_info_cell, Cell::kValueOffset));
6812 __ Ldr(x10, FieldMemOperand(x10, 0)); 6815 __ Ldr(x10, FieldMemOperand(x10, 0));
6813 __ JumpIfNotRoot(x10, Heap::kAllocationSiteMapRootIndex, &normal_sequence); 6816 __ JumpIfNotRoot(x10, Heap::kAllocationSiteMapRootIndex, &normal_sequence);
6814 6817
6815 // Save the resulting elements kind in type info. 6818 // Save the resulting elements kind in type info.
6816 // TODO(jbramley): Tag and store at the same time. 6819 // TODO(jbramley): Tag and store at the same time.
6817 __ SmiTag(x10, kind); 6820 __ SmiTag(x10, kind);
6818 __ Ldr(x11, FieldMemOperand(type_info_cell, Cell::kValueOffset)); 6821 __ Ldr(x11, FieldMemOperand(type_info_cell, Cell::kValueOffset));
6819 __ Str(x10, FieldMemOperand(x11, AllocationSite::kPayloadOffset)); 6822 __ Str(x10, FieldMemOperand(x11, AllocationSite::kTransitionInfoOffset));
6820 6823
6821 __ Bind(&normal_sequence); 6824 __ Bind(&normal_sequence);
6822 int last_index = GetSequenceIndexFromFastElementsKind( 6825 int last_index = GetSequenceIndexFromFastElementsKind(
6823 TERMINAL_FAST_ELEMENTS_KIND); 6826 TERMINAL_FAST_ELEMENTS_KIND);
6824 for (int i = 0; i <= last_index; ++i) { 6827 for (int i = 0; i <= last_index; ++i) {
6825 Label next; 6828 Label next;
6826 ElementsKind candidate_kind = GetFastElementsKindFromSequenceIndex(i); 6829 ElementsKind candidate_kind = GetFastElementsKindFromSequenceIndex(i);
6827 // TODO(jbramley): Is this the best way to handle this? Can we make the tail 6830 // TODO(jbramley): Is this the best way to handle this? Can we make the tail
6828 // calls conditional, rather than hopping over each one? 6831 // calls conditional, rather than hopping over each one?
6829 __ CompareAndBranch(kind, candidate_kind, ne, &next); 6832 __ CompareAndBranch(kind, candidate_kind, ne, &next);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
6917 6920
6918 Register kind = x3; 6921 Register kind = x3;
6919 Label no_info, switch_ready; 6922 Label no_info, switch_ready;
6920 // Get the elements kind and case on that. 6923 // Get the elements kind and case on that.
6921 __ JumpIfRoot(type_info_cell, Heap::kUndefinedValueRootIndex, &no_info); 6924 __ JumpIfRoot(type_info_cell, Heap::kUndefinedValueRootIndex, &no_info);
6922 __ Ldr(kind, FieldMemOperand(type_info_cell, PropertyCell::kValueOffset)); 6925 __ Ldr(kind, FieldMemOperand(type_info_cell, PropertyCell::kValueOffset));
6923 6926
6924 // The type cell may have undefined in its value. 6927 // The type cell may have undefined in its value.
6925 __ JumpIfRoot(kind, Heap::kUndefinedValueRootIndex, &no_info); 6928 __ JumpIfRoot(kind, Heap::kUndefinedValueRootIndex, &no_info);
6926 6929
6927 // We should have an allocation site object 6930 // The type cell has either an AllocationSite or a JSFunction.
6928 if (FLAG_debug_code) { 6931 __ Ldr(x10, FieldMemOperand(kind, AllocationSite::kMapOffset));
6929 __ Ldr(x10, FieldMemOperand(kind, AllocationSite::kMapOffset)); 6932 __ JumpIfNotRoot(x10, Heap::kAllocationSiteMapRootIndex, &no_info);
6930 __ CompareRoot(x10, Heap::kAllocationSiteMapRootIndex);
6931 __ Assert(eq, "Expected AllocationSite object.");
6932 }
6933 6933
6934 __ Ldrsw(kind, UntagSmiFieldMemOperand(kind, AllocationSite::kPayloadOffset)); 6934 __ Ldrsw(kind,
6935 UntagSmiFieldMemOperand(kind,
6936 AllocationSite::kTransitionInfoOffset));
6935 __ B(&switch_ready); 6937 __ B(&switch_ready);
6936 6938
6937 __ Bind(&no_info); 6939 __ Bind(&no_info);
6938 __ Mov(kind, GetInitialFastElementsKind()); 6940 __ Mov(kind, GetInitialFastElementsKind());
6939 __ Bind(&switch_ready); 6941 __ Bind(&switch_ready);
6940 6942
6941 if (argument_count_ == ANY) { 6943 if (argument_count_ == ANY) {
6942 Label zero_case, n_case; 6944 Label zero_case, n_case;
6943 __ Cbz(argc, &zero_case); 6945 __ Cbz(argc, &zero_case);
6944 __ Cmp(argc, 1); 6946 __ Cmp(argc, 1);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
7059 __ Bind(&fast_elements_case); 7061 __ Bind(&fast_elements_case);
7060 GenerateCase(masm, FAST_ELEMENTS); 7062 GenerateCase(masm, FAST_ELEMENTS);
7061 } 7063 }
7062 7064
7063 7065
7064 #undef __ 7066 #undef __
7065 7067
7066 } } // namespace v8::internal 7068 } } // namespace v8::internal
7067 7069
7068 #endif // V8_TARGET_ARCH_A64 7070 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « samples/shell.cc ('k') | src/a64/ic-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698