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

Side by Side Diff: src/x64/full-codegen-x64.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 | « src/mips/full-codegen-mips.cc ('k') | test/mjsunit/regress/regress-crbug-320922.js » ('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 3423 matching lines...) Expand 10 before | Expand all | Expand 10 after
3434 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { 3434 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3435 ZoneList<Expression*>* args = expr->arguments(); 3435 ZoneList<Expression*>* args = expr->arguments();
3436 ASSERT_EQ(3, args->length()); 3436 ASSERT_EQ(3, args->length());
3437 3437
3438 Register string = rax; 3438 Register string = rax;
3439 Register index = rbx; 3439 Register index = rbx;
3440 Register value = rcx; 3440 Register value = rcx;
3441 3441
3442 VisitForStackValue(args->at(1)); // index 3442 VisitForStackValue(args->at(1)); // index
3443 VisitForStackValue(args->at(2)); // value 3443 VisitForStackValue(args->at(2)); // value
3444 VisitForAccumulatorValue(args->at(0)); // string
3444 __ pop(value); 3445 __ pop(value);
3445 __ pop(index); 3446 __ pop(index);
3446 VisitForAccumulatorValue(args->at(0)); // string
3447 3447
3448 if (FLAG_debug_code) { 3448 if (FLAG_debug_code) {
3449 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; 3449 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
3450 EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type); 3450 EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type);
3451 } 3451 }
3452 3452
3453 __ SmiToInteger32(value, value); 3453 __ SmiToInteger32(value, value);
3454 __ SmiToInteger32(index, index); 3454 __ SmiToInteger32(index, index);
3455 __ movb(FieldOperand(string, index, times_1, SeqOneByteString::kHeaderSize), 3455 __ movb(FieldOperand(string, index, times_1, SeqOneByteString::kHeaderSize),
3456 value); 3456 value);
3457 context()->Plug(string); 3457 context()->Plug(string);
3458 } 3458 }
3459 3459
3460 3460
3461 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) { 3461 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
3462 ZoneList<Expression*>* args = expr->arguments(); 3462 ZoneList<Expression*>* args = expr->arguments();
3463 ASSERT_EQ(3, args->length()); 3463 ASSERT_EQ(3, args->length());
3464 3464
3465 Register string = rax; 3465 Register string = rax;
3466 Register index = rbx; 3466 Register index = rbx;
3467 Register value = rcx; 3467 Register value = rcx;
3468 3468
3469 VisitForStackValue(args->at(1)); // index 3469 VisitForStackValue(args->at(1)); // index
3470 VisitForStackValue(args->at(2)); // value 3470 VisitForStackValue(args->at(2)); // value
3471 VisitForAccumulatorValue(args->at(0)); // string
3471 __ pop(value); 3472 __ pop(value);
3472 __ pop(index); 3473 __ pop(index);
3473 VisitForAccumulatorValue(args->at(0)); // string
3474 3474
3475 if (FLAG_debug_code) { 3475 if (FLAG_debug_code) {
3476 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; 3476 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
3477 EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type); 3477 EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
3478 } 3478 }
3479 3479
3480 __ SmiToInteger32(value, value); 3480 __ SmiToInteger32(value, value);
3481 __ SmiToInteger32(index, index); 3481 __ SmiToInteger32(index, index);
3482 __ movw(FieldOperand(string, index, times_2, SeqTwoByteString::kHeaderSize), 3482 __ movw(FieldOperand(string, index, times_2, SeqTwoByteString::kHeaderSize),
3483 value); 3483 value);
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
4951 4951
4952 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4952 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4953 Assembler::target_address_at(call_target_address)); 4953 Assembler::target_address_at(call_target_address));
4954 return OSR_AFTER_STACK_CHECK; 4954 return OSR_AFTER_STACK_CHECK;
4955 } 4955 }
4956 4956
4957 4957
4958 } } // namespace v8::internal 4958 } } // namespace v8::internal
4959 4959
4960 #endif // V8_TARGET_ARCH_X64 4960 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | test/mjsunit/regress/regress-crbug-320922.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698