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

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

Issue 11428137: ARM: Make use of d16-d31 when available. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { 881 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
882 // Set the register values. The values are not important as there are no 882 // Set the register values. The values are not important as there are no
883 // callee saved registers in JavaScript frames, so all registers are 883 // callee saved registers in JavaScript frames, so all registers are
884 // spilled. Registers fp and sp are set to the correct values though. 884 // spilled. Registers fp and sp are set to the correct values though.
885 885
886 for (int i = 0; i < Register::kNumRegisters; i++) { 886 for (int i = 0; i < Register::kNumRegisters; i++) {
887 input_->SetRegister(i, i * 4); 887 input_->SetRegister(i, i * 4);
888 } 888 }
889 input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp())); 889 input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp()));
890 input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp())); 890 input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp()));
891 for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) { 891 for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) {
892 input_->SetDoubleRegister(i, 0.0); 892 input_->SetDoubleRegister(i, 0.0);
893 } 893 }
894 894
895 // Fill the frame content from the actual data on the frame. 895 // Fill the frame content from the actual data on the frame.
896 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { 896 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
897 input_->SetFrameSlot(i, Memory::uint32_at(tos + i)); 897 input_->SetFrameSlot(i, Memory::uint32_at(tos + i));
898 } 898 }
899 } 899 }
900 900
901 901
902 #define __ masm()-> 902 #define __ masm()->
903 903
904 // This code tries to be close to ia32 code so that any changes can be 904 // This code tries to be close to ia32 code so that any changes can be
905 // easily ported. 905 // easily ported.
906 void Deoptimizer::EntryGenerator::Generate() { 906 void Deoptimizer::EntryGenerator::Generate() {
907 GeneratePrologue(); 907 GeneratePrologue();
908 908
909 Isolate* isolate = masm()->isolate(); 909 Isolate* isolate = masm()->isolate();
910 910
911 CpuFeatures::Scope scope(VFP3); 911 CpuFeatures::Scope scope(VFP3);
912 // Save all general purpose registers before messing with them. 912 // Save all general purpose registers before messing with them.
913 const int kNumberOfRegisters = Register::kNumRegisters; 913 const int kNumberOfRegisters = Register::kNumRegisters;
914 914
915 // Everything but pc, lr and ip which will be saved but not restored. 915 // Everything but pc, lr and ip which will be saved but not restored.
916 RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit(); 916 RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit();
917 917
918 const int kDoubleRegsSize = 918 const int kDoubleRegsSize =
919 kDoubleSize * DwVfpRegister::kNumAllocatableRegisters; 919 kDoubleSize * DwVfpRegister::NumAllocatableRegisters();
920 920
921 // Save all VFP registers before messing with them. 921 // Save all VFP registers before messing with them.
922 DwVfpRegister first = DwVfpRegister::FromAllocationIndex(0); 922 DwVfpRegister first = DwVfpRegister::FromAllocationIndex(0);
923 DwVfpRegister last = 923 DwVfpRegister last =
924 DwVfpRegister::FromAllocationIndex( 924 DwVfpRegister::FromAllocationIndex(
925 DwVfpRegister::kNumAllocatableRegisters - 1); 925 DwVfpRegister::NumAllocatableRegisters() - 1);
926 ASSERT(last.code() > first.code()); 926 ASSERT(last.code() > first.code());
927 ASSERT((last.code() - first.code()) == 927 //ASSERT((last.code() - first.code()) ==
928 (DwVfpRegister::kNumAllocatableRegisters - 1)); 928 // (DwVfpRegister::NumAllocatableRegisters() - 1));
929 #ifdef DEBUG 929 #ifdef DEBUG
930 for (int i = 0; i <= (DwVfpRegister::kNumAllocatableRegisters - 1); i++) { 930 for (int i = 0; i <= (DwVfpRegister::NumAllocatableRegisters() - 1); i++) {
931 ASSERT((DwVfpRegister::FromAllocationIndex(i).code() <= last.code()) && 931 ASSERT((DwVfpRegister::FromAllocationIndex(i).code() <= last.code()) &&
932 (DwVfpRegister::FromAllocationIndex(i).code() >= first.code())); 932 (DwVfpRegister::FromAllocationIndex(i).code() >= first.code()));
933 } 933 }
934 #endif 934 #endif
935 __ vstm(db_w, sp, first, last); 935 ASSERT(DwVfpRegister::ScratchReg().code() == DwVfpRegister::ZeroReg().code() + 1);
936 if (last.code() > DwVfpRegister::ScratchReg().code()) {
937 // This happens when we also have d16-d31 available.
938 __ vstm(db_w, sp, first, DwVfpRegister::from_code(DwVfpRegister::ZeroReg().c ode() - 1));
939 __ vstm(db_w, sp, DwVfpRegister::from_code(DwVfpRegister::ScratchReg().code( ) + 1), last);
940 } else {
941 __ vstm(db_w, sp, first, last);
942 }
936 943
937 // Push all 16 registers (needed to populate FrameDescription::registers_). 944 // Push all 16 registers (needed to populate FrameDescription::registers_).
938 // TODO(1588) Note that using pc with stm is deprecated, so we should perhaps 945 // TODO(1588) Note that using pc with stm is deprecated, so we should perhaps
939 // handle this a bit differently. 946 // handle this a bit differently.
940 __ stm(db_w, sp, restored_regs | sp.bit() | lr.bit() | pc.bit()); 947 __ stm(db_w, sp, restored_regs | sp.bit() | lr.bit() | pc.bit());
941 948
942 const int kSavedRegistersAreaSize = 949 const int kSavedRegistersAreaSize =
943 (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; 950 (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize;
944 951
945 // Get the bailout id from the stack. 952 // Get the bailout id from the stack.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 ASSERT(Register::kNumRegisters == kNumberOfRegisters); 994 ASSERT(Register::kNumRegisters == kNumberOfRegisters);
988 for (int i = 0; i < kNumberOfRegisters; i++) { 995 for (int i = 0; i < kNumberOfRegisters; i++) {
989 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 996 int offset = (i * kPointerSize) + FrameDescription::registers_offset();
990 __ ldr(r2, MemOperand(sp, i * kPointerSize)); 997 __ ldr(r2, MemOperand(sp, i * kPointerSize));
991 __ str(r2, MemOperand(r1, offset)); 998 __ str(r2, MemOperand(r1, offset));
992 } 999 }
993 1000
994 // Copy VFP registers to 1001 // Copy VFP registers to
995 // double_registers_[DoubleRegister::kNumAllocatableRegisters] 1002 // double_registers_[DoubleRegister::kNumAllocatableRegisters]
996 int double_regs_offset = FrameDescription::double_registers_offset(); 1003 int double_regs_offset = FrameDescription::double_registers_offset();
997 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) { 1004 for (int i = 0; i < DwVfpRegister::NumAllocatableRegisters(); ++i) {
998 int dst_offset = i * kDoubleSize + double_regs_offset; 1005 int dst_offset = i * kDoubleSize + double_regs_offset;
999 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; 1006 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize;
1000 __ vldr(d0, sp, src_offset); 1007 __ vldr(d0, sp, src_offset);
1001 __ vstr(d0, r1, dst_offset); 1008 __ vstr(d0, r1, dst_offset);
1002 } 1009 }
1003 1010
1004 // Remove the bailout id, eventually return address, and the saved registers 1011 // Remove the bailout id, eventually return address, and the saved registers
1005 // from the stack. 1012 // from the stack.
1006 if (type() == EAGER || type() == OSR) { 1013 if (type() == EAGER || type() == OSR) {
1007 __ add(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); 1014 __ add(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 __ push(ip); 1117 __ push(ip);
1111 __ b(&done); 1118 __ b(&done);
1112 ASSERT(masm()->pc_offset() - start == table_entry_size_); 1119 ASSERT(masm()->pc_offset() - start == table_entry_size_);
1113 } 1120 }
1114 __ bind(&done); 1121 __ bind(&done);
1115 } 1122 }
1116 1123
1117 #undef __ 1124 #undef __
1118 1125
1119 } } // namespace v8::internal 1126 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698