OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 4466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4477 // DoStringCharCodeAt above. | 4477 // DoStringCharCodeAt above. |
4478 if (instr->index()->IsConstantOperand()) { | 4478 if (instr->index()->IsConstantOperand()) { |
4479 int const_index = ToInteger32(LConstantOperand::cast(instr->index())); | 4479 int const_index = ToInteger32(LConstantOperand::cast(instr->index())); |
4480 __ Addu(scratch, zero_reg, Operand(Smi::FromInt(const_index))); | 4480 __ Addu(scratch, zero_reg, Operand(Smi::FromInt(const_index))); |
4481 __ push(scratch); | 4481 __ push(scratch); |
4482 } else { | 4482 } else { |
4483 Register index = ToRegister(instr->index()); | 4483 Register index = ToRegister(instr->index()); |
4484 __ SmiTag(index); | 4484 __ SmiTag(index); |
4485 __ push(index); | 4485 __ push(index); |
4486 } | 4486 } |
4487 CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr, | 4487 CallRuntimeFromDeferred(Runtime::kHiddenStringCharCodeAt, 2, instr, |
4488 instr->context()); | 4488 instr->context()); |
4489 __ AssertSmi(v0); | 4489 __ AssertSmi(v0); |
4490 __ SmiUntag(v0); | 4490 __ SmiUntag(v0); |
4491 __ StoreToSafepointRegisterSlot(v0, result); | 4491 __ StoreToSafepointRegisterSlot(v0, result); |
4492 } | 4492 } |
4493 | 4493 |
4494 | 4494 |
4495 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4495 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
4496 class DeferredStringCharFromCode V8_FINAL : public LDeferredCode { | 4496 class DeferredStringCharFromCode V8_FINAL : public LDeferredCode { |
4497 public: | 4497 public: |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5814 __ Subu(scratch, result, scratch); | 5814 __ Subu(scratch, result, scratch); |
5815 __ lw(result, FieldMemOperand(scratch, | 5815 __ lw(result, FieldMemOperand(scratch, |
5816 FixedArray::kHeaderSize - kPointerSize)); | 5816 FixedArray::kHeaderSize - kPointerSize)); |
5817 __ bind(&done); | 5817 __ bind(&done); |
5818 } | 5818 } |
5819 | 5819 |
5820 | 5820 |
5821 #undef __ | 5821 #undef __ |
5822 | 5822 |
5823 } } // namespace v8::internal | 5823 } } // namespace v8::internal |
OLD | NEW |