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 5354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5365 __ Mov(result, 0); | 5365 __ Mov(result, 0); |
5366 | 5366 |
5367 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 5367 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
5368 __ Push(string); | 5368 __ Push(string); |
5369 // Push the index as a smi. This is safe because of the checks in | 5369 // Push the index as a smi. This is safe because of the checks in |
5370 // DoStringCharCodeAt above. | 5370 // DoStringCharCodeAt above. |
5371 Register index = ToRegister(instr->index()); | 5371 Register index = ToRegister(instr->index()); |
5372 __ SmiTag(index); | 5372 __ SmiTag(index); |
5373 __ Push(index); | 5373 __ Push(index); |
5374 | 5374 |
5375 CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr, | 5375 CallRuntimeFromDeferred(Runtime::kHiddenStringCharCodeAt, 2, instr, |
5376 instr->context()); | 5376 instr->context()); |
5377 __ AssertSmi(x0); | 5377 __ AssertSmi(x0); |
5378 __ SmiUntag(x0); | 5378 __ SmiUntag(x0); |
5379 __ StoreToSafepointRegisterSlot(x0, result); | 5379 __ StoreToSafepointRegisterSlot(x0, result); |
5380 } | 5380 } |
5381 | 5381 |
5382 | 5382 |
5383 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 5383 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
5384 class DeferredStringCharFromCode: public LDeferredCode { | 5384 class DeferredStringCharFromCode: public LDeferredCode { |
5385 public: | 5385 public: |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5854 __ Bind(&out_of_object); | 5854 __ Bind(&out_of_object); |
5855 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5855 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5856 // Index is equal to negated out of object property index plus 1. | 5856 // Index is equal to negated out of object property index plus 1. |
5857 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5857 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5858 __ Ldr(result, FieldMemOperand(result, | 5858 __ Ldr(result, FieldMemOperand(result, |
5859 FixedArray::kHeaderSize - kPointerSize)); | 5859 FixedArray::kHeaderSize - kPointerSize)); |
5860 __ Bind(&done); | 5860 __ Bind(&done); |
5861 } | 5861 } |
5862 | 5862 |
5863 } } // namespace v8::internal | 5863 } } // namespace v8::internal |
OLD | NEW |