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

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: Use enum instead of bool 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
« no previous file with comments | « src/a64/full-codegen-a64.cc ('k') | src/a64/macro-assembler-a64.h » ('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 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, kIndexIsInteger32, temp,
4541 } 4538 encoding_mask);
4542 } 4539 }
4543 4540 MemOperand operand =
4544 __ Add(temp, string, SeqString::kHeaderSize - kHeapObjectTag); 4541 BuildSeqStringOperand(string, temp, instr->index(), encoding);
4545 if (encoding == String::ONE_BYTE_ENCODING) { 4542 if (encoding == String::ONE_BYTE_ENCODING) {
4546 __ Strb(value, MemOperand(temp, index)); 4543 __ Strb(value, operand);
4547 } else { 4544 } else {
4548 __ Strh(value, MemOperand(temp, index, LSL, 1)); 4545 __ Strh(value, operand);
4549 } 4546 }
4550 } 4547 }
4551 4548
4552 4549
4553 void LCodeGen::DoSmiTag(LSmiTag* instr) { 4550 void LCodeGen::DoSmiTag(LSmiTag* instr) {
4554 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); 4551 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
4555 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value())); 4552 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value()));
4556 } 4553 }
4557 4554
4558 4555
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
5687 __ Bind(&out_of_object); 5684 __ Bind(&out_of_object);
5688 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5685 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5689 // Index is equal to negated out of object property index plus 1. 5686 // Index is equal to negated out of object property index plus 1.
5690 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5687 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5691 __ Ldr(result, FieldMemOperand(result, 5688 __ Ldr(result, FieldMemOperand(result,
5692 FixedArray::kHeaderSize - kPointerSize)); 5689 FixedArray::kHeaderSize - kPointerSize));
5693 __ Bind(&done); 5690 __ Bind(&done);
5694 } 5691 }
5695 5692
5696 } } // namespace v8::internal 5693 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/full-codegen-a64.cc ('k') | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698