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

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

Issue 12391055: Cleaned up CpuFeature scope handling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed nits Created 7 years, 9 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/code-stubs-arm.cc ('k') | src/arm/deoptimizer-arm.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 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (!CpuFeatures::IsSupported(VFP2)) return &exp; 65 if (!CpuFeatures::IsSupported(VFP2)) return &exp;
66 if (!FLAG_fast_math) return &exp; 66 if (!FLAG_fast_math) return &exp;
67 size_t actual_size; 67 size_t actual_size;
68 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); 68 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true));
69 if (buffer == NULL) return &exp; 69 if (buffer == NULL) return &exp;
70 ExternalReference::InitializeMathExpData(); 70 ExternalReference::InitializeMathExpData();
71 71
72 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); 72 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size));
73 73
74 { 74 {
75 CpuFeatures::Scope use_vfp(VFP2); 75 CpuFeatureScope use_vfp(&masm, VFP2);
76 DwVfpRegister input = d0; 76 DwVfpRegister input = d0;
77 DwVfpRegister result = d1; 77 DwVfpRegister result = d1;
78 DwVfpRegister double_scratch1 = d2; 78 DwVfpRegister double_scratch1 = d2;
79 DwVfpRegister double_scratch2 = d3; 79 DwVfpRegister double_scratch2 = d3;
80 Register temp1 = r4; 80 Register temp1 = r4;
81 Register temp2 = r5; 81 Register temp2 = r5;
82 Register temp3 = r6; 82 Register temp3 = r6;
83 83
84 if (masm.use_eabi_hardfloat()) { 84 if (masm.use_eabi_hardfloat()) {
85 // Input value is in d0 anyway, nothing to do. 85 // Input value is in d0 anyway, nothing to do.
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 __ b(fail); 270 __ b(fail);
271 271
272 // Convert and copy elements. 272 // Convert and copy elements.
273 __ bind(&loop); 273 __ bind(&loop);
274 __ ldr(r9, MemOperand(r3, 4, PostIndex)); 274 __ ldr(r9, MemOperand(r3, 4, PostIndex));
275 // r9: current element 275 // r9: current element
276 __ UntagAndJumpIfNotSmi(r9, r9, &convert_hole); 276 __ UntagAndJumpIfNotSmi(r9, r9, &convert_hole);
277 277
278 // Normal smi, convert to double and store. 278 // Normal smi, convert to double and store.
279 if (vfp2_supported) { 279 if (vfp2_supported) {
280 CpuFeatures::Scope scope(VFP2); 280 CpuFeatureScope scope(masm, VFP2);
281 __ vmov(s0, r9); 281 __ vmov(s0, r9);
282 __ vcvt_f64_s32(d0, s0); 282 __ vcvt_f64_s32(d0, s0);
283 __ vstr(d0, r7, 0); 283 __ vstr(d0, r7, 0);
284 __ add(r7, r7, Operand(8)); 284 __ add(r7, r7, Operand(8));
285 } else { 285 } else {
286 FloatingPointHelper::ConvertIntToDouble(masm, 286 FloatingPointHelper::ConvertIntToDouble(masm,
287 r9, 287 r9,
288 FloatingPointHelper::kCoreRegisters, 288 FloatingPointHelper::kCoreRegisters,
289 d0, 289 d0,
290 r0, 290 r0,
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 patcher.masm()->add(r0, pc, Operand(-8)); 699 patcher.masm()->add(r0, pc, Operand(-8));
700 patcher.masm()->ldr(pc, MemOperand(pc, -4)); 700 patcher.masm()->ldr(pc, MemOperand(pc, -4));
701 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); 701 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
702 } 702 }
703 } 703 }
704 704
705 705
706 } } // namespace v8::internal 706 } } // namespace v8::internal
707 707
708 #endif // V8_TARGET_ARCH_ARM 708 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/deoptimizer-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698