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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 23480031: Enable preaging of code objects when --optimize-for-size. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: bool -> enum Created 7 years, 1 month 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 | « src/arm/macro-assembler-arm.h ('k') | src/assembler.h » ('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 // 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 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 CompareRoot(object, Heap::kUndefinedValueRootIndex); 909 CompareRoot(object, Heap::kUndefinedValueRootIndex);
910 b(ne, not_int32); 910 b(ne, not_int32);
911 // |undefined| is truncated to 0. 911 // |undefined| is truncated to 0.
912 mov(dst, Operand(Smi::FromInt(0))); 912 mov(dst, Operand(Smi::FromInt(0)));
913 // Fall through. 913 // Fall through.
914 914
915 bind(&done); 915 bind(&done);
916 } 916 }
917 917
918 918
919 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
920 if (frame_mode == BUILD_STUB_FRAME) {
921 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
922 Push(Smi::FromInt(StackFrame::STUB));
923 // Adjust FP to point to saved FP.
924 add(fp, sp, Operand(2 * kPointerSize));
925 } else {
926 PredictableCodeSizeScope predictible_code_size_scope(
927 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize);
928 // The following three instructions must remain together and unmodified
929 // for code aging to work properly.
930 if (FLAG_optimize_for_size && FLAG_age_code) {
931 // Pre-age the code.
932 Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
933 add(r0, pc, Operand(-8));
934 ldr(pc, MemOperand(pc, -4));
935 dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
936 } else {
937 stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
938 nop(ip.code());
939 // Adjust FP to point to saved FP.
940 add(fp, sp, Operand(2 * kPointerSize));
941 }
942 }
943 }
944
945
919 void MacroAssembler::EnterFrame(StackFrame::Type type) { 946 void MacroAssembler::EnterFrame(StackFrame::Type type) {
920 // r0-r3: preserved 947 // r0-r3: preserved
921 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); 948 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
922 mov(ip, Operand(Smi::FromInt(type))); 949 mov(ip, Operand(Smi::FromInt(type)));
923 push(ip); 950 push(ip);
924 mov(ip, Operand(CodeObject())); 951 mov(ip, Operand(CodeObject()));
925 push(ip); 952 push(ip);
926 add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP. 953 add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP.
927 } 954 }
928 955
(...skipping 3036 matching lines...) Expand 10 before | Expand all | Expand 10 after
3965 void CodePatcher::EmitCondition(Condition cond) { 3992 void CodePatcher::EmitCondition(Condition cond) {
3966 Instr instr = Assembler::instr_at(masm_.pc_); 3993 Instr instr = Assembler::instr_at(masm_.pc_);
3967 instr = (instr & ~kCondMask) | cond; 3994 instr = (instr & ~kCondMask) | cond;
3968 masm_.emit(instr); 3995 masm_.emit(instr);
3969 } 3996 }
3970 3997
3971 3998
3972 } } // namespace v8::internal 3999 } } // namespace v8::internal
3973 4000
3974 #endif // V8_TARGET_ARCH_ARM 4001 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698