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

Side by Side Diff: src/a64/lithium-codegen-a64.cc

Issue 141713009: A64: Port LSeqStringSetChar optimizations from r16707 and r17521. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 4504 matching lines...) Expand 10 before | Expand all | Expand 10 after
4515 BuildSeqStringOperand(string, temp, instr->index(), encoding); 4515 BuildSeqStringOperand(string, temp, instr->index(), encoding);
4516 if (encoding == String::ONE_BYTE_ENCODING) { 4516 if (encoding == String::ONE_BYTE_ENCODING) {
4517 __ Ldrb(result, operand); 4517 __ Ldrb(result, operand);
4518 } else { 4518 } else {
4519 __ Ldrh(result, operand); 4519 __ Ldrh(result, operand);
4520 } 4520 }
4521 } 4521 }
4522 4522
4523 4523
4524 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { 4524 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
4525 // TODO(all): Port ARM optimizations from r16707.
4526
4527 String::Encoding encoding = instr->encoding(); 4525 String::Encoding encoding = instr->encoding();
4528 Register string = ToRegister(instr->string()); 4526 Register string = ToRegister(instr->string());
4529 Register index = ToRegister(instr->index());
4530 Register value = ToRegister(instr->value()); 4527 Register value = ToRegister(instr->value());
4531 Register temp = ToRegister(instr->temp()); 4528 Register temp = ToRegister(instr->temp());
4532 4529
4533 if (FLAG_debug_code) { 4530 if (FLAG_debug_code) {
4534 if (encoding == String::ONE_BYTE_ENCODING) { 4531 Register index = ToRegister(instr->index());
4535 __ EmitSeqStringSetCharCheck( 4532 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
4536 string, index, kSeqStringTag | kOneByteStringTag); 4533 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
4537 } else { 4534 int encoding_mask =
4538 ASSERT(encoding == String::TWO_BYTE_ENCODING); 4535 instr->hydrogen()->encoding() == String::ONE_BYTE_ENCODING
4539 __ EmitSeqStringSetCharCheck( 4536 ? one_byte_seq_type : two_byte_seq_type;
4540 string, index, kSeqStringTag | kTwoByteStringTag); 4537 __ EmitSeqStringSetCharCheck(string, index, false, temp, encoding_mask);
4541 }
4542 } 4538 }
4543 4539 MemOperand operand =
4544 __ Add(temp, string, SeqString::kHeaderSize - kHeapObjectTag); 4540 BuildSeqStringOperand(string, temp, instr->index(), encoding);
4545 if (encoding == String::ONE_BYTE_ENCODING) { 4541 if (encoding == String::ONE_BYTE_ENCODING) {
4546 __ Strb(value, MemOperand(temp, index)); 4542 __ Strb(value, operand);
4547 } else { 4543 } else {
4548 __ Strh(value, MemOperand(temp, index, LSL, 1)); 4544 __ Strh(value, operand);
4549 } 4545 }
4550 } 4546 }
4551 4547
4552 4548
4553 void LCodeGen::DoSmiTag(LSmiTag* instr) { 4549 void LCodeGen::DoSmiTag(LSmiTag* instr) {
4554 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); 4550 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
4555 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value())); 4551 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value()));
4556 } 4552 }
4557 4553
4558 4554
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
5687 __ Bind(&out_of_object); 5683 __ Bind(&out_of_object);
5688 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5684 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5689 // Index is equal to negated out of object property index plus 1. 5685 // Index is equal to negated out of object property index plus 1.
5690 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5686 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5691 __ Ldr(result, FieldMemOperand(result, 5687 __ Ldr(result, FieldMemOperand(result,
5692 FixedArray::kHeaderSize - kPointerSize)); 5688 FixedArray::kHeaderSize - kPointerSize));
5693 __ Bind(&done); 5689 __ Bind(&done);
5694 } 5690 }
5695 5691
5696 } } // namespace v8::internal 5692 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698