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

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

Issue 7281009: Version 3.4.8... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 5 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 | « src/arm/macro-assembler-arm.h ('k') | src/bootstrapper.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 mov(ip, Operand(handle)); 302 mov(ip, Operand(handle));
303 push(ip); 303 push(ip);
304 } 304 }
305 305
306 306
307 void MacroAssembler::Move(Register dst, Handle<Object> value) { 307 void MacroAssembler::Move(Register dst, Handle<Object> value) {
308 mov(dst, Operand(value)); 308 mov(dst, Operand(value));
309 } 309 }
310 310
311 311
312 void MacroAssembler::Move(Register dst, Register src) { 312 void MacroAssembler::Move(Register dst, Register src, Condition cond) {
313 if (!dst.is(src)) { 313 if (!dst.is(src)) {
314 mov(dst, src); 314 mov(dst, src, LeaveCC, cond);
315 } 315 }
316 } 316 }
317 317
318 318
319 void MacroAssembler::Move(DoubleRegister dst, DoubleRegister src) { 319 void MacroAssembler::Move(DoubleRegister dst, DoubleRegister src) {
320 ASSERT(CpuFeatures::IsSupported(VFP3)); 320 ASSERT(CpuFeatures::IsSupported(VFP3));
321 CpuFeatures::Scope scope(VFP3); 321 CpuFeatures::Scope scope(VFP3);
322 if (!dst.is(src)) { 322 if (!dst.is(src)) {
323 vmov(dst, src); 323 vmov(dst, src);
324 } 324 }
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 748
749 void MacroAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1, 749 void MacroAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1,
750 const double src2, 750 const double src2,
751 const Register fpscr_flags, 751 const Register fpscr_flags,
752 const Condition cond) { 752 const Condition cond) {
753 // Compare and load FPSCR. 753 // Compare and load FPSCR.
754 vcmp(src1, src2, cond); 754 vcmp(src1, src2, cond);
755 vmrs(fpscr_flags, cond); 755 vmrs(fpscr_flags, cond);
756 } 756 }
757 757
758 void MacroAssembler::Vmov(const DwVfpRegister dst,
759 const double imm,
760 const Condition cond) {
761 ASSERT(CpuFeatures::IsEnabled(VFP3));
762 static const DoubleRepresentation minus_zero(-0.0);
763 static const DoubleRepresentation zero(0.0);
764 DoubleRepresentation value(imm);
765 // Handle special values first.
766 if (value.bits == zero.bits) {
767 vmov(dst, kDoubleRegZero, cond);
768 } else if (value.bits == minus_zero.bits) {
769 vneg(dst, kDoubleRegZero, cond);
770 } else {
771 vmov(dst, imm, cond);
772 }
773 }
774
758 775
759 void MacroAssembler::EnterFrame(StackFrame::Type type) { 776 void MacroAssembler::EnterFrame(StackFrame::Type type) {
760 // r0-r3: preserved 777 // r0-r3: preserved
761 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); 778 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
762 mov(ip, Operand(Smi::FromInt(type))); 779 mov(ip, Operand(Smi::FromInt(type)));
763 push(ip); 780 push(ip);
764 mov(ip, Operand(CodeObject())); 781 mov(ip, Operand(CodeObject()));
765 push(ip); 782 push(ip);
766 add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP. 783 add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP.
767 } 784 }
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
2555 ldr(dst, MemOperand(cp, Context::SlotOffset(Context::PREVIOUS_INDEX))); 2572 ldr(dst, MemOperand(cp, Context::SlotOffset(Context::PREVIOUS_INDEX)));
2556 for (int i = 1; i < context_chain_length; i++) { 2573 for (int i = 1; i < context_chain_length; i++) {
2557 ldr(dst, MemOperand(dst, Context::SlotOffset(Context::PREVIOUS_INDEX))); 2574 ldr(dst, MemOperand(dst, Context::SlotOffset(Context::PREVIOUS_INDEX)));
2558 } 2575 }
2559 } else { 2576 } else {
2560 // Slot is in the current function context. Move it into the 2577 // Slot is in the current function context. Move it into the
2561 // destination register in case we store into it (the write barrier 2578 // destination register in case we store into it (the write barrier
2562 // cannot be allowed to destroy the context in esi). 2579 // cannot be allowed to destroy the context in esi).
2563 mov(dst, cp); 2580 mov(dst, cp);
2564 } 2581 }
2565
2566 // We should not have found a 'with' context by walking the context chain
2567 // (i.e., the static scope chain and runtime context chain do not agree).
2568 // A variable occurring in such a scope should have slot type LOOKUP and
2569 // not CONTEXT.
2570 if (emit_debug_code()) {
2571 ldr(ip, MemOperand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
2572 cmp(dst, ip);
2573 Check(eq, "Yo dawg, I heard you liked function contexts "
2574 "so I put function contexts in all your contexts");
2575 }
2576 } 2582 }
2577 2583
2578 2584
2579 void MacroAssembler::LoadGlobalFunction(int index, Register function) { 2585 void MacroAssembler::LoadGlobalFunction(int index, Register function) {
2580 // Load the global or builtins object from the current context. 2586 // Load the global or builtins object from the current context.
2581 ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 2587 ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
2582 // Load the global context from the global or builtins object. 2588 // Load the global context from the global or builtins object.
2583 ldr(function, FieldMemOperand(function, 2589 ldr(function, FieldMemOperand(function,
2584 GlobalObject::kGlobalContextOffset)); 2590 GlobalObject::kGlobalContextOffset));
2585 // Load the function from the global context. 2591 // Load the function from the global context.
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
3105 } 3111 }
3106 3112
3107 3113
3108 void MacroAssembler::ClampDoubleToUint8(Register result_reg, 3114 void MacroAssembler::ClampDoubleToUint8(Register result_reg,
3109 DoubleRegister input_reg, 3115 DoubleRegister input_reg,
3110 DoubleRegister temp_double_reg) { 3116 DoubleRegister temp_double_reg) {
3111 Label above_zero; 3117 Label above_zero;
3112 Label done; 3118 Label done;
3113 Label in_bounds; 3119 Label in_bounds;
3114 3120
3115 vmov(temp_double_reg, 0.0); 3121 Vmov(temp_double_reg, 0.0);
3116 VFPCompareAndSetFlags(input_reg, temp_double_reg); 3122 VFPCompareAndSetFlags(input_reg, temp_double_reg);
3117 b(gt, &above_zero); 3123 b(gt, &above_zero);
3118 3124
3119 // Double value is less than zero, NaN or Inf, return 0. 3125 // Double value is less than zero, NaN or Inf, return 0.
3120 mov(result_reg, Operand(0)); 3126 mov(result_reg, Operand(0));
3121 b(al, &done); 3127 b(al, &done);
3122 3128
3123 // Double value is >= 255, return 255. 3129 // Double value is >= 255, return 255.
3124 bind(&above_zero); 3130 bind(&above_zero);
3125 vmov(temp_double_reg, 255.0); 3131 Vmov(temp_double_reg, 255.0);
3126 VFPCompareAndSetFlags(input_reg, temp_double_reg); 3132 VFPCompareAndSetFlags(input_reg, temp_double_reg);
3127 b(le, &in_bounds); 3133 b(le, &in_bounds);
3128 mov(result_reg, Operand(255)); 3134 mov(result_reg, Operand(255));
3129 b(al, &done); 3135 b(al, &done);
3130 3136
3131 // In 0-255 range, round and truncate. 3137 // In 0-255 range, round and truncate.
3132 bind(&in_bounds); 3138 bind(&in_bounds);
3133 vmov(temp_double_reg, 0.5); 3139 Vmov(temp_double_reg, 0.5);
3134 vadd(temp_double_reg, input_reg, temp_double_reg); 3140 vadd(temp_double_reg, input_reg, temp_double_reg);
3135 vcvt_u32_f64(s0, temp_double_reg); 3141 vcvt_u32_f64(s0, temp_double_reg);
3136 vmov(result_reg, s0); 3142 vmov(result_reg, s0);
3137 bind(&done); 3143 bind(&done);
3138 } 3144 }
3139 3145
3140 3146
3141 void MacroAssembler::LoadInstanceDescriptors(Register map, 3147 void MacroAssembler::LoadInstanceDescriptors(Register map,
3142 Register descriptors) { 3148 Register descriptors) {
3143 ldr(descriptors, 3149 ldr(descriptors,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 void CodePatcher::EmitCondition(Condition cond) { 3190 void CodePatcher::EmitCondition(Condition cond) {
3185 Instr instr = Assembler::instr_at(masm_.pc_); 3191 Instr instr = Assembler::instr_at(masm_.pc_);
3186 instr = (instr & ~kCondMask) | cond; 3192 instr = (instr & ~kCondMask) | cond;
3187 masm_.emit(instr); 3193 masm_.emit(instr);
3188 } 3194 }
3189 3195
3190 3196
3191 } } // namespace v8::internal 3197 } } // namespace v8::internal
3192 3198
3193 #endif // V8_TARGET_ARCH_ARM 3199 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698