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/regexp-macro-assembler-arm.cc

Issue 11087047: Allow unaligned accesses for ARMv7. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 8 years, 2 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/regexp-macro-assembler-arm.h ('k') | src/arm/simulator-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 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 __ mov(code_pointer(), Operand(function)); 1351 __ mov(code_pointer(), Operand(function));
1352 RegExpCEntryStub stub; 1352 RegExpCEntryStub stub;
1353 __ CallStub(&stub); 1353 __ CallStub(&stub);
1354 if (OS::ActivationFrameAlignment() != 0) { 1354 if (OS::ActivationFrameAlignment() != 0) {
1355 __ ldr(sp, MemOperand(sp, 0)); 1355 __ ldr(sp, MemOperand(sp, 0));
1356 } 1356 }
1357 __ mov(code_pointer(), Operand(masm_->CodeObject())); 1357 __ mov(code_pointer(), Operand(masm_->CodeObject()));
1358 } 1358 }
1359 1359
1360 1360
1361 bool RegExpMacroAssemblerARM::CanReadUnaligned() {
1362 return CpuFeatures::IsSupported(UNALIGNED_ACCESSES) && !slow_safe();
1363 }
1364
1365
1361 void RegExpMacroAssemblerARM::LoadCurrentCharacterUnchecked(int cp_offset, 1366 void RegExpMacroAssemblerARM::LoadCurrentCharacterUnchecked(int cp_offset,
1362 int characters) { 1367 int characters) {
1363 Register offset = current_input_offset(); 1368 Register offset = current_input_offset();
1364 if (cp_offset != 0) { 1369 if (cp_offset != 0) {
1365 // r4 is not being used to store the capture start index at this point. 1370 // r4 is not being used to store the capture start index at this point.
1366 __ add(r4, current_input_offset(), Operand(cp_offset * char_size())); 1371 __ add(r4, current_input_offset(), Operand(cp_offset * char_size()));
1367 offset = r4; 1372 offset = r4;
1368 } 1373 }
1369 // The ldr, str, ldrh, strh instructions can do unaligned accesses, if the CPU 1374 // The ldr, str, ldrh, strh instructions can do unaligned accesses, if the CPU
1370 // and the operating system running on the target allow it. 1375 // and the operating system running on the target allow it.
1371 // If unaligned load/stores are not supported then this function must only 1376 // If unaligned load/stores are not supported then this function must only
1372 // be used to load a single character at a time. 1377 // be used to load a single character at a time.
1373 #if !V8_TARGET_CAN_READ_UNALIGNED 1378 if (!CanReadUnaligned()) {
1374 ASSERT(characters == 1); 1379 ASSERT(characters == 1);
1375 #endif 1380 }
1376 1381
1377 if (mode_ == ASCII) { 1382 if (mode_ == ASCII) {
1378 if (characters == 4) { 1383 if (characters == 4) {
1379 __ ldr(current_character(), MemOperand(end_of_input_address(), offset)); 1384 __ ldr(current_character(), MemOperand(end_of_input_address(), offset));
1380 } else if (characters == 2) { 1385 } else if (characters == 2) {
1381 __ ldrh(current_character(), MemOperand(end_of_input_address(), offset)); 1386 __ ldrh(current_character(), MemOperand(end_of_input_address(), offset));
1382 } else { 1387 } else {
1383 ASSERT(characters == 1); 1388 ASSERT(characters == 1);
1384 __ ldrb(current_character(), MemOperand(end_of_input_address(), offset)); 1389 __ ldrb(current_character(), MemOperand(end_of_input_address(), offset));
1385 } 1390 }
(...skipping 20 matching lines...) Expand all
1406 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); 1411 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex));
1407 } 1412 }
1408 1413
1409 #undef __ 1414 #undef __
1410 1415
1411 #endif // V8_INTERPRETED_REGEXP 1416 #endif // V8_INTERPRETED_REGEXP
1412 1417
1413 }} // namespace v8::internal 1418 }} // namespace v8::internal
1414 1419
1415 #endif // V8_TARGET_ARCH_ARM 1420 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/regexp-macro-assembler-arm.h ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698