OLD | NEW |
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 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1996 __ bind(&runtime); | 1996 __ bind(&runtime); |
1997 __ PrepareCallCFunction(2, scratch); | 1997 __ PrepareCallCFunction(2, scratch); |
1998 __ mov(r1, Operand(index)); | 1998 __ mov(r1, Operand(index)); |
1999 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); | 1999 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
2000 __ bind(&done); | 2000 __ bind(&done); |
2001 } | 2001 } |
2002 } | 2002 } |
2003 | 2003 |
2004 | 2004 |
2005 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { | 2005 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { |
2006 SeqStringSetCharGenerator::Generate(masm(), | 2006 Register string = ToRegister(instr->string()); |
2007 instr->encoding(), | 2007 Register index = ToRegister(instr->index()); |
2008 ToRegister(instr->string()), | 2008 Register value = ToRegister(instr->value()); |
2009 ToRegister(instr->index()), | 2009 String::Encoding encoding = instr->encoding(); |
2010 ToRegister(instr->value())); | 2010 |
| 2011 if (FLAG_debug_code) { |
| 2012 __ ldr(ip, FieldMemOperand(string, HeapObject::kMapOffset)); |
| 2013 __ ldrb(ip, FieldMemOperand(ip, Map::kInstanceTypeOffset)); |
| 2014 |
| 2015 __ and_(ip, ip, Operand(kStringRepresentationMask | kStringEncodingMask)); |
| 2016 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; |
| 2017 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
| 2018 __ cmp(ip, Operand(encoding == String::ONE_BYTE_ENCODING |
| 2019 ? one_byte_seq_type : two_byte_seq_type)); |
| 2020 __ Check(eq, "Unexpected string type"); |
| 2021 } |
| 2022 |
| 2023 __ add(ip, |
| 2024 string, |
| 2025 Operand(SeqString::kHeaderSize - kHeapObjectTag)); |
| 2026 if (encoding == String::ONE_BYTE_ENCODING) { |
| 2027 __ strb(value, MemOperand(ip, index)); |
| 2028 } else { |
| 2029 // MemOperand with ip as the base register is not allowed for strh, so |
| 2030 // we do the address calculation explicitly. |
| 2031 __ add(ip, ip, Operand(index, LSL, 1)); |
| 2032 __ strh(value, MemOperand(ip)); |
| 2033 } |
2011 } | 2034 } |
2012 | 2035 |
2013 | 2036 |
2014 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 2037 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
2015 Register input = ToRegister(instr->value()); | 2038 Register input = ToRegister(instr->value()); |
2016 Register result = ToRegister(instr->result()); | 2039 Register result = ToRegister(instr->result()); |
2017 __ mvn(result, Operand(input)); | 2040 __ mvn(result, Operand(input)); |
2018 } | 2041 } |
2019 | 2042 |
2020 | 2043 |
(...skipping 3901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5922 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5945 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5923 __ ldr(result, FieldMemOperand(scratch, | 5946 __ ldr(result, FieldMemOperand(scratch, |
5924 FixedArray::kHeaderSize - kPointerSize)); | 5947 FixedArray::kHeaderSize - kPointerSize)); |
5925 __ bind(&done); | 5948 __ bind(&done); |
5926 } | 5949 } |
5927 | 5950 |
5928 | 5951 |
5929 #undef __ | 5952 #undef __ |
5930 | 5953 |
5931 } } // namespace v8::internal | 5954 } } // namespace v8::internal |
OLD | NEW |