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

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

Issue 67103003: Fix register trashing in Emit*ByteSeqStringSetChar (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | src/ia32/full-codegen-ia32.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 3502 matching lines...) Expand 10 before | Expand all | Expand 10 after
3513 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { 3513 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3514 ZoneList<Expression*>* args = expr->arguments(); 3514 ZoneList<Expression*>* args = expr->arguments();
3515 ASSERT_EQ(3, args->length()); 3515 ASSERT_EQ(3, args->length());
3516 3516
3517 Register string = r0; 3517 Register string = r0;
3518 Register index = r1; 3518 Register index = r1;
3519 Register value = r2; 3519 Register value = r2;
3520 3520
3521 VisitForStackValue(args->at(1)); // index 3521 VisitForStackValue(args->at(1)); // index
3522 VisitForStackValue(args->at(2)); // value 3522 VisitForStackValue(args->at(2)); // value
3523 VisitForAccumulatorValue(args->at(0)); // string
3523 __ Pop(index, value); 3524 __ Pop(index, value);
3524 VisitForAccumulatorValue(args->at(0)); // string
3525 3525
3526 if (FLAG_debug_code) { 3526 if (FLAG_debug_code) {
3527 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; 3527 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
3528 EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type); 3528 EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type);
3529 } 3529 }
3530 3530
3531 __ SmiUntag(value, value); 3531 __ SmiUntag(value, value);
3532 __ add(ip, 3532 __ add(ip,
3533 string, 3533 string,
3534 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); 3534 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag));
3535 __ strb(value, MemOperand(ip, index, LSR, kSmiTagSize)); 3535 __ strb(value, MemOperand(ip, index, LSR, kSmiTagSize));
3536 context()->Plug(string); 3536 context()->Plug(string);
3537 } 3537 }
3538 3538
3539 3539
3540 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) { 3540 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
3541 ZoneList<Expression*>* args = expr->arguments(); 3541 ZoneList<Expression*>* args = expr->arguments();
3542 ASSERT_EQ(3, args->length()); 3542 ASSERT_EQ(3, args->length());
3543 3543
3544 Register string = r0; 3544 Register string = r0;
3545 Register index = r1; 3545 Register index = r1;
3546 Register value = r2; 3546 Register value = r2;
3547 3547
3548 VisitForStackValue(args->at(1)); // index 3548 VisitForStackValue(args->at(1)); // index
3549 VisitForStackValue(args->at(2)); // value 3549 VisitForStackValue(args->at(2)); // value
3550 VisitForAccumulatorValue(args->at(0)); // string
3550 __ Pop(index, value); 3551 __ Pop(index, value);
3551 VisitForAccumulatorValue(args->at(0)); // string
3552 3552
3553 if (FLAG_debug_code) { 3553 if (FLAG_debug_code) {
3554 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; 3554 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
3555 EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type); 3555 EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
3556 } 3556 }
3557 3557
3558 __ SmiUntag(value, value); 3558 __ SmiUntag(value, value);
3559 __ add(ip, 3559 __ add(ip,
3560 string, 3560 string,
3561 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); 3561 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
4978 ASSERT(Memory::uint32_at(interrupt_address_pointer) == 4978 ASSERT(Memory::uint32_at(interrupt_address_pointer) ==
4979 reinterpret_cast<uint32_t>( 4979 reinterpret_cast<uint32_t>(
4980 isolate->builtins()->OsrAfterStackCheck()->entry())); 4980 isolate->builtins()->OsrAfterStackCheck()->entry()));
4981 return OSR_AFTER_STACK_CHECK; 4981 return OSR_AFTER_STACK_CHECK;
4982 } 4982 }
4983 4983
4984 4984
4985 } } // namespace v8::internal 4985 } } // namespace v8::internal
4986 4986
4987 #endif // V8_TARGET_ARCH_ARM 4987 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698