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

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

Issue 144933002: ARM: Reduce the stack requirements of GetNoCodeAgeSequence. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Address review comments Created 6 years, 11 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 | « no previous file | no next file » | 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 // 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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 #endif 850 #endif
851 851
852 static byte* GetNoCodeAgeSequence(uint32_t* length) { 852 static byte* GetNoCodeAgeSequence(uint32_t* length) {
853 // The sequence of instructions that is patched out for aging code is the 853 // The sequence of instructions that is patched out for aging code is the
854 // following boilerplate stack-building prologue that is found in FUNCTIONS 854 // following boilerplate stack-building prologue that is found in FUNCTIONS
855 static bool initialized = false; 855 static bool initialized = false;
856 static uint32_t sequence[kNoCodeAgeSequenceLength]; 856 static uint32_t sequence[kNoCodeAgeSequenceLength];
857 byte* byte_sequence = reinterpret_cast<byte*>(sequence); 857 byte* byte_sequence = reinterpret_cast<byte*>(sequence);
858 *length = kNoCodeAgeSequenceLength * Assembler::kInstrSize; 858 *length = kNoCodeAgeSequenceLength * Assembler::kInstrSize;
859 if (!initialized) { 859 if (!initialized) {
860 CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength); 860 // Since patcher is a large object, allocate it dynamically when needed,
861 PredictableCodeSizeScope scope(patcher.masm(), *length); 861 // to avoid overloading the stack in stress conditions.
862 patcher.masm()->PushFixedFrame(r1); 862 SmartPointer<CodePatcher>
863 patcher.masm()->nop(ip.code()); 863 patcher(new CodePatcher(byte_sequence, kNoCodeAgeSequenceLength));
864 patcher.masm()->add(fp, sp, 864 PredictableCodeSizeScope scope(patcher->masm(), *length);
865 Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 865 patcher->masm()->PushFixedFrame(r1);
866 patcher->masm()->nop(ip.code());
867 patcher->masm()->add(
868 fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
866 initialized = true; 869 initialized = true;
867 } 870 }
868 return byte_sequence; 871 return byte_sequence;
869 } 872 }
870 873
871 874
872 bool Code::IsYoungSequence(byte* sequence) { 875 bool Code::IsYoungSequence(byte* sequence) {
873 uint32_t young_length; 876 uint32_t young_length;
874 byte* young_sequence = GetNoCodeAgeSequence(&young_length); 877 byte* young_sequence = GetNoCodeAgeSequence(&young_length);
875 bool result = !memcmp(sequence, young_sequence, young_length); 878 bool result = !memcmp(sequence, young_sequence, young_length);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 patcher.masm()->add(r0, pc, Operand(-8)); 911 patcher.masm()->add(r0, pc, Operand(-8));
909 patcher.masm()->ldr(pc, MemOperand(pc, -4)); 912 patcher.masm()->ldr(pc, MemOperand(pc, -4));
910 patcher.masm()->emit_code_stub_address(stub); 913 patcher.masm()->emit_code_stub_address(stub);
911 } 914 }
912 } 915 }
913 916
914 917
915 } } // namespace v8::internal 918 } } // namespace v8::internal
916 919
917 #endif // V8_TARGET_ARCH_ARM 920 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698