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

Side by Side Diff: src/ia32/full-codegen-ia32.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/arm/full-codegen-arm.cc ('k') | src/mips/full-codegen-mips.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 3458 matching lines...) Expand 10 before | Expand all | Expand 10 after
3469 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { 3469 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3470 ZoneList<Expression*>* args = expr->arguments(); 3470 ZoneList<Expression*>* args = expr->arguments();
3471 ASSERT_EQ(3, args->length()); 3471 ASSERT_EQ(3, args->length());
3472 3472
3473 Register string = eax; 3473 Register string = eax;
3474 Register index = ebx; 3474 Register index = ebx;
3475 Register value = ecx; 3475 Register value = ecx;
3476 3476
3477 VisitForStackValue(args->at(1)); // index 3477 VisitForStackValue(args->at(1)); // index
3478 VisitForStackValue(args->at(2)); // value 3478 VisitForStackValue(args->at(2)); // value
3479 VisitForAccumulatorValue(args->at(0)); // string
3480
3479 __ pop(value); 3481 __ pop(value);
3480 __ pop(index); 3482 __ pop(index);
3481 VisitForAccumulatorValue(args->at(0)); // string
3482
3483 3483
3484 if (FLAG_debug_code) { 3484 if (FLAG_debug_code) {
3485 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; 3485 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
3486 EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type); 3486 EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type);
3487 } 3487 }
3488 3488
3489 __ SmiUntag(value); 3489 __ SmiUntag(value);
3490 __ SmiUntag(index); 3490 __ SmiUntag(index);
3491 __ mov_b(FieldOperand(string, index, times_1, SeqOneByteString::kHeaderSize), 3491 __ mov_b(FieldOperand(string, index, times_1, SeqOneByteString::kHeaderSize),
3492 value); 3492 value);
3493 context()->Plug(string); 3493 context()->Plug(string);
3494 } 3494 }
3495 3495
3496 3496
3497 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) { 3497 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
3498 ZoneList<Expression*>* args = expr->arguments(); 3498 ZoneList<Expression*>* args = expr->arguments();
3499 ASSERT_EQ(3, args->length()); 3499 ASSERT_EQ(3, args->length());
3500 3500
3501 Register string = eax; 3501 Register string = eax;
3502 Register index = ebx; 3502 Register index = ebx;
3503 Register value = ecx; 3503 Register value = ecx;
3504 3504
3505 VisitForStackValue(args->at(1)); // index 3505 VisitForStackValue(args->at(1)); // index
3506 VisitForStackValue(args->at(2)); // value 3506 VisitForStackValue(args->at(2)); // value
3507 VisitForAccumulatorValue(args->at(0)); // string
3507 __ pop(value); 3508 __ pop(value);
3508 __ pop(index); 3509 __ pop(index);
3509 VisitForAccumulatorValue(args->at(0)); // string
3510 3510
3511 if (FLAG_debug_code) { 3511 if (FLAG_debug_code) {
3512 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; 3512 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
3513 EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type); 3513 EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
3514 } 3514 }
3515 3515
3516 __ SmiUntag(value); 3516 __ SmiUntag(value);
3517 // No need to untag a smi for two-byte addressing. 3517 // No need to untag a smi for two-byte addressing.
3518 __ mov_w(FieldOperand(string, index, times_1, SeqTwoByteString::kHeaderSize), 3518 __ mov_w(FieldOperand(string, index, times_1, SeqTwoByteString::kHeaderSize),
3519 value); 3519 value);
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
4968 4968
4969 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4969 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4970 Assembler::target_address_at(call_target_address)); 4970 Assembler::target_address_at(call_target_address));
4971 return OSR_AFTER_STACK_CHECK; 4971 return OSR_AFTER_STACK_CHECK;
4972 } 4972 }
4973 4973
4974 4974
4975 } } // namespace v8::internal 4975 } } // namespace v8::internal
4976 4976
4977 #endif // V8_TARGET_ARCH_IA32 4977 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698