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

Side by Side Diff: src/arm/builtins-arm.cc

Issue 1162993006: Add support for Embedded Constant Pools for PPC and Arm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/debug.h" 10 #include "src/debug.h"
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 867
868 868
869 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, 869 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
870 bool is_construct) { 870 bool is_construct) {
871 // Called from Generate_JS_Entry 871 // Called from Generate_JS_Entry
872 // r0: code entry 872 // r0: code entry
873 // r1: function 873 // r1: function
874 // r2: receiver 874 // r2: receiver
875 // r3: argc 875 // r3: argc
876 // r4: argv 876 // r4: argv
877 // r5-r6, r8 (if not FLAG_enable_ool_constant_pool) and cp may be clobbered 877 // r5-r6, r8 (if !FLAG_enable_embedded_constant_pool) and cp may be clobbered
878 ProfileEntryHookStub::MaybeCallEntryHook(masm); 878 ProfileEntryHookStub::MaybeCallEntryHook(masm);
879 879
880 // Clear the context before we push it when entering the internal frame. 880 // Clear the context before we push it when entering the internal frame.
881 __ mov(cp, Operand::Zero()); 881 __ mov(cp, Operand::Zero());
882 882
883 // Enter an internal frame. 883 // Enter an internal frame.
884 { 884 {
885 FrameScope scope(masm, StackFrame::INTERNAL); 885 FrameScope scope(masm, StackFrame::INTERNAL);
886 886
887 // Set up the context from the function argument. 887 // Set up the context from the function argument.
(...skipping 27 matching lines...) Expand all
915 __ push(r0); // push parameter 915 __ push(r0); // push parameter
916 __ bind(&entry); 916 __ bind(&entry);
917 __ cmp(r4, r2); 917 __ cmp(r4, r2);
918 __ b(ne, &loop); 918 __ b(ne, &loop);
919 919
920 // Initialize all JavaScript callee-saved registers, since they will be seen 920 // Initialize all JavaScript callee-saved registers, since they will be seen
921 // by the garbage collector as part of handlers. 921 // by the garbage collector as part of handlers.
922 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); 922 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex);
923 __ mov(r5, Operand(r4)); 923 __ mov(r5, Operand(r4));
924 __ mov(r6, Operand(r4)); 924 __ mov(r6, Operand(r4));
925 if (!FLAG_enable_ool_constant_pool) { 925 if (!FLAG_enable_embedded_constant_pool) {
926 __ mov(r8, Operand(r4)); 926 __ mov(r8, Operand(r4));
927 } 927 }
928 if (kR9Available == 1) { 928 if (kR9Available == 1) {
929 __ mov(r9, Operand(r4)); 929 __ mov(r9, Operand(r4));
930 } 930 }
931 931
932 // Invoke the code and pass argc as r0. 932 // Invoke the code and pass argc as r0.
933 __ mov(r0, Operand(r3)); 933 __ mov(r0, Operand(r3));
934 if (is_construct) { 934 if (is_construct) {
935 // No type feedback cell is available 935 // No type feedback cell is available
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 __ b(ne, &skip); 1159 __ b(ne, &skip);
1160 __ Ret(); 1160 __ Ret();
1161 1161
1162 __ bind(&skip); 1162 __ bind(&skip);
1163 1163
1164 // Load deoptimization data from the code object. 1164 // Load deoptimization data from the code object.
1165 // <deopt_data> = <code>[#deoptimization_data_offset] 1165 // <deopt_data> = <code>[#deoptimization_data_offset]
1166 __ ldr(r1, FieldMemOperand(r0, Code::kDeoptimizationDataOffset)); 1166 __ ldr(r1, FieldMemOperand(r0, Code::kDeoptimizationDataOffset));
1167 1167
1168 { ConstantPoolUnavailableScope constant_pool_unavailable(masm); 1168 { ConstantPoolUnavailableScope constant_pool_unavailable(masm);
1169 if (FLAG_enable_ool_constant_pool) { 1169 if (FLAG_enable_embedded_constant_pool) {
1170 __ ldr(pp, FieldMemOperand(r0, Code::kConstantPoolOffset)); 1170 __ LoadConstantPoolPointerRegisterFromCodeTargetAddress(r0);
1171 } 1171 }
1172 1172
1173 // Load the OSR entrypoint offset from the deoptimization data. 1173 // Load the OSR entrypoint offset from the deoptimization data.
1174 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset] 1174 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset]
1175 __ ldr(r1, FieldMemOperand(r1, FixedArray::OffsetOfElementAt( 1175 __ ldr(r1, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(
1176 DeoptimizationInputData::kOsrPcOffsetIndex))); 1176 DeoptimizationInputData::kOsrPcOffsetIndex)));
1177 1177
1178 // Compute the target address = code_obj + header_size + osr_offset 1178 // Compute the target address = code_obj + header_size + osr_offset
1179 // <entry_addr> = <code_obj> + #header_size + <osr_offset> 1179 // <entry_addr> = <code_obj> + #header_size + <osr_offset>
1180 __ add(r0, r0, Operand::SmiUntag(r1)); 1180 __ add(r0, r0, Operand::SmiUntag(r1));
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 // Check if the arguments will overflow the stack. 1642 // Check if the arguments will overflow the stack.
1643 __ cmp(r5, Operand(r2, LSL, kPointerSizeLog2)); 1643 __ cmp(r5, Operand(r2, LSL, kPointerSizeLog2));
1644 __ b(le, stack_overflow); // Signed comparison. 1644 __ b(le, stack_overflow); // Signed comparison.
1645 } 1645 }
1646 1646
1647 1647
1648 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { 1648 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
1649 __ SmiTag(r0); 1649 __ SmiTag(r0);
1650 __ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 1650 __ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1651 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | 1651 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() |
1652 (FLAG_enable_ool_constant_pool ? pp.bit() : 0) | 1652 (FLAG_enable_embedded_constant_pool ? pp.bit() : 0) |
1653 fp.bit() | lr.bit()); 1653 fp.bit() | lr.bit());
1654 __ add(fp, sp, 1654 __ add(fp, sp,
1655 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize)); 1655 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize));
1656 } 1656 }
1657 1657
1658 1658
1659 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { 1659 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
1660 // ----------- S t a t e ------------- 1660 // ----------- S t a t e -------------
1661 // -- r0 : result being passed through 1661 // -- r0 : result being passed through
1662 // ----------------------------------- 1662 // -----------------------------------
1663 // Get the number of arguments passed (as a smi), tear down the frame and 1663 // Get the number of arguments passed (as a smi), tear down the frame and
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 } 1810 }
1811 } 1811 }
1812 1812
1813 1813
1814 #undef __ 1814 #undef __
1815 1815
1816 } // namespace internal 1816 } // namespace internal
1817 } // namespace v8 1817 } // namespace v8
1818 1818
1819 #endif // V8_TARGET_ARCH_ARM 1819 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm-inl.h ('k') | src/arm/code-stubs-arm.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698