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 4445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4456 // DoStringCharCodeAt above. | 4456 // DoStringCharCodeAt above. |
4457 if (instr->index()->IsConstantOperand()) { | 4457 if (instr->index()->IsConstantOperand()) { |
4458 int const_index = ToInteger32(LConstantOperand::cast(instr->index())); | 4458 int const_index = ToInteger32(LConstantOperand::cast(instr->index())); |
4459 __ mov(scratch, Operand(Smi::FromInt(const_index))); | 4459 __ mov(scratch, Operand(Smi::FromInt(const_index))); |
4460 __ push(scratch); | 4460 __ push(scratch); |
4461 } else { | 4461 } else { |
4462 Register index = ToRegister(instr->index()); | 4462 Register index = ToRegister(instr->index()); |
4463 __ SmiTag(index); | 4463 __ SmiTag(index); |
4464 __ push(index); | 4464 __ push(index); |
4465 } | 4465 } |
4466 CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr, | 4466 CallRuntimeFromDeferred(Runtime::kHiddenStringCharCodeAt, 2, instr, |
4467 instr->context()); | 4467 instr->context()); |
4468 __ AssertSmi(r0); | 4468 __ AssertSmi(r0); |
4469 __ SmiUntag(r0); | 4469 __ SmiUntag(r0); |
4470 __ StoreToSafepointRegisterSlot(r0, result); | 4470 __ StoreToSafepointRegisterSlot(r0, result); |
4471 } | 4471 } |
4472 | 4472 |
4473 | 4473 |
4474 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4474 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
4475 class DeferredStringCharFromCode V8_FINAL : public LDeferredCode { | 4475 class DeferredStringCharFromCode V8_FINAL : public LDeferredCode { |
4476 public: | 4476 public: |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5738 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5738 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5739 __ ldr(result, FieldMemOperand(scratch, | 5739 __ ldr(result, FieldMemOperand(scratch, |
5740 FixedArray::kHeaderSize - kPointerSize)); | 5740 FixedArray::kHeaderSize - kPointerSize)); |
5741 __ bind(&done); | 5741 __ bind(&done); |
5742 } | 5742 } |
5743 | 5743 |
5744 | 5744 |
5745 #undef __ | 5745 #undef __ |
5746 | 5746 |
5747 } } // namespace v8::internal | 5747 } } // namespace v8::internal |
OLD | NEW |