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

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

Issue 15743006: Improve SeqStringSetChar implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: small fix Created 7 years, 7 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/x64/full-codegen-x64.cc ('k') | test/mjsunit/string-fromcharcode.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 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 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 __ movq(arg_reg_1, object); 1659 __ movq(arg_reg_1, object);
1660 __ movq(arg_reg_2, index, RelocInfo::NONE64); 1660 __ movq(arg_reg_2, index, RelocInfo::NONE64);
1661 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); 1661 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
1662 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 1662 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
1663 __ bind(&done); 1663 __ bind(&done);
1664 } 1664 }
1665 } 1665 }
1666 1666
1667 1667
1668 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { 1668 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
1669 SeqStringSetCharGenerator::Generate(masm(), 1669 Register string = ToRegister(instr->string());
1670 instr->encoding(), 1670 Register index = ToRegister(instr->index());
1671 ToRegister(instr->string()), 1671 Register value = ToRegister(instr->value());
1672 ToRegister(instr->index()), 1672 String::Encoding encoding = instr->encoding();
1673 ToRegister(instr->value())); 1673
1674 if (FLAG_debug_code) {
1675 __ push(value);
1676 __ movq(value, FieldOperand(string, HeapObject::kMapOffset));
1677 __ movzxbq(value, FieldOperand(value, Map::kInstanceTypeOffset));
1678
1679 __ andb(value, Immediate(kStringRepresentationMask | kStringEncodingMask));
1680 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
1681 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
1682 __ cmpq(value, Immediate(encoding == String::ONE_BYTE_ENCODING
1683 ? one_byte_seq_type : two_byte_seq_type));
1684 __ Check(equal, "Unexpected string type");
1685 __ pop(value);
1686 }
1687
1688 if (encoding == String::ONE_BYTE_ENCODING) {
1689 __ movb(FieldOperand(string, index, times_1, SeqString::kHeaderSize),
1690 value);
1691 } else {
1692 __ movw(FieldOperand(string, index, times_2, SeqString::kHeaderSize),
1693 value);
1694 }
1674 } 1695 }
1675 1696
1676 1697
1677 void LCodeGen::DoBitNotI(LBitNotI* instr) { 1698 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1678 LOperand* input = instr->value(); 1699 LOperand* input = instr->value();
1679 ASSERT(input->Equals(instr->result())); 1700 ASSERT(input->Equals(instr->result()));
1680 __ not_(ToRegister(input)); 1701 __ not_(ToRegister(input));
1681 } 1702 }
1682 1703
1683 1704
(...skipping 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after
5620 FixedArray::kHeaderSize - kPointerSize)); 5641 FixedArray::kHeaderSize - kPointerSize));
5621 __ bind(&done); 5642 __ bind(&done);
5622 } 5643 }
5623 5644
5624 5645
5625 #undef __ 5646 #undef __
5626 5647
5627 } } // namespace v8::internal 5648 } } // namespace v8::internal
5628 5649
5629 #endif // V8_TARGET_ARCH_X64 5650 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | test/mjsunit/string-fromcharcode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698