OLD | NEW |
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 5143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5154 virtual LInstruction* instr() { return instr_; } | 5154 virtual LInstruction* instr() { return instr_; } |
5155 private: | 5155 private: |
5156 LStringCharCodeAt* instr_; | 5156 LStringCharCodeAt* instr_; |
5157 }; | 5157 }; |
5158 | 5158 |
5159 DeferredStringCharCodeAt* deferred = | 5159 DeferredStringCharCodeAt* deferred = |
5160 new(zone()) DeferredStringCharCodeAt(this, instr); | 5160 new(zone()) DeferredStringCharCodeAt(this, instr); |
5161 | 5161 |
5162 StringCharLoadGenerator::Generate(masm(), | 5162 StringCharLoadGenerator::Generate(masm(), |
5163 ToRegister(instr->string()), | 5163 ToRegister(instr->string()), |
5164 ToRegister(instr->index()), | 5164 ToRegister32(instr->index()), |
5165 ToRegister(instr->result()), | 5165 ToRegister(instr->result()), |
5166 deferred->entry()); | 5166 deferred->entry()); |
5167 __ Bind(deferred->exit()); | 5167 __ Bind(deferred->exit()); |
5168 } | 5168 } |
5169 | 5169 |
5170 | 5170 |
5171 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { | 5171 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { |
5172 Register string = ToRegister(instr->string()); | 5172 Register string = ToRegister(instr->string()); |
5173 Register result = ToRegister(instr->result()); | 5173 Register result = ToRegister(instr->result()); |
5174 | 5174 |
(...skipping 26 matching lines...) Expand all Loading... |
5201 virtual void Generate() { codegen()->DoDeferredStringCharFromCode(instr_); } | 5201 virtual void Generate() { codegen()->DoDeferredStringCharFromCode(instr_); } |
5202 virtual LInstruction* instr() { return instr_; } | 5202 virtual LInstruction* instr() { return instr_; } |
5203 private: | 5203 private: |
5204 LStringCharFromCode* instr_; | 5204 LStringCharFromCode* instr_; |
5205 }; | 5205 }; |
5206 | 5206 |
5207 DeferredStringCharFromCode* deferred = | 5207 DeferredStringCharFromCode* deferred = |
5208 new(zone()) DeferredStringCharFromCode(this, instr); | 5208 new(zone()) DeferredStringCharFromCode(this, instr); |
5209 | 5209 |
5210 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); | 5210 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); |
5211 Register char_code = ToRegister(instr->char_code()); | 5211 Register char_code = ToRegister32(instr->char_code()); |
5212 Register result = ToRegister(instr->result()); | 5212 Register result = ToRegister(instr->result()); |
5213 | 5213 |
5214 __ Cmp(char_code, Operand(String::kMaxOneByteCharCode)); | 5214 __ Cmp(char_code, String::kMaxOneByteCharCode); |
5215 __ B(hi, deferred->entry()); | 5215 __ B(hi, deferred->entry()); |
5216 __ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex); | 5216 __ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex); |
5217 __ Add(result, result, Operand(char_code, LSL, kPointerSizeLog2)); | 5217 __ Add(result, result, Operand(char_code, SXTW, kPointerSizeLog2)); |
5218 __ Ldr(result, FieldMemOperand(result, FixedArray::kHeaderSize)); | 5218 __ Ldr(result, FieldMemOperand(result, FixedArray::kHeaderSize)); |
5219 __ CompareRoot(result, Heap::kUndefinedValueRootIndex); | 5219 __ CompareRoot(result, Heap::kUndefinedValueRootIndex); |
5220 __ B(eq, deferred->entry()); | 5220 __ B(eq, deferred->entry()); |
5221 __ Bind(deferred->exit()); | 5221 __ Bind(deferred->exit()); |
5222 } | 5222 } |
5223 | 5223 |
5224 | 5224 |
5225 void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) { | 5225 void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) { |
5226 Register char_code = ToRegister(instr->char_code()); | 5226 Register char_code = ToRegister(instr->char_code()); |
5227 Register result = ToRegister(instr->result()); | 5227 Register result = ToRegister(instr->result()); |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5690 __ Bind(&out_of_object); | 5690 __ Bind(&out_of_object); |
5691 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5691 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5692 // Index is equal to negated out of object property index plus 1. | 5692 // Index is equal to negated out of object property index plus 1. |
5693 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5693 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5694 __ Ldr(result, FieldMemOperand(result, | 5694 __ Ldr(result, FieldMemOperand(result, |
5695 FixedArray::kHeaderSize - kPointerSize)); | 5695 FixedArray::kHeaderSize - kPointerSize)); |
5696 __ Bind(&done); | 5696 __ Bind(&done); |
5697 } | 5697 } |
5698 | 5698 |
5699 } } // namespace v8::internal | 5699 } } // namespace v8::internal |
OLD | NEW |