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 4452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4463 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); | 4463 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); |
4464 if (instr->index()->IsConstantOperand()) { | 4464 if (instr->index()->IsConstantOperand()) { |
4465 int32_t const_index = ToInteger32(LConstantOperand::cast(instr->index())); | 4465 int32_t const_index = ToInteger32(LConstantOperand::cast(instr->index())); |
4466 __ Push(Smi::FromInt(const_index)); | 4466 __ Push(Smi::FromInt(const_index)); |
4467 } else { | 4467 } else { |
4468 Register index = ToRegister(instr->index()); | 4468 Register index = ToRegister(instr->index()); |
4469 __ Integer32ToSmi(index, index); | 4469 __ Integer32ToSmi(index, index); |
4470 __ Push(index); | 4470 __ Push(index); |
4471 } | 4471 } |
4472 CallRuntimeFromDeferred( | 4472 CallRuntimeFromDeferred( |
4473 Runtime::kStringCharCodeAt, 2, instr, instr->context()); | 4473 Runtime::kStringCharCodeAtInternal, 2, instr, instr->context()); |
4474 __ AssertSmi(rax); | 4474 __ AssertSmi(rax); |
4475 __ SmiToInteger32(rax, rax); | 4475 __ SmiToInteger32(rax, rax); |
4476 __ StoreToSafepointRegisterSlot(result, rax); | 4476 __ StoreToSafepointRegisterSlot(result, rax); |
4477 } | 4477 } |
4478 | 4478 |
4479 | 4479 |
4480 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4480 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
4481 class DeferredStringCharFromCode V8_FINAL : public LDeferredCode { | 4481 class DeferredStringCharFromCode V8_FINAL : public LDeferredCode { |
4482 public: | 4482 public: |
4483 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 4483 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5659 FixedArray::kHeaderSize - kPointerSize)); | 5659 FixedArray::kHeaderSize - kPointerSize)); |
5660 __ bind(&done); | 5660 __ bind(&done); |
5661 } | 5661 } |
5662 | 5662 |
5663 | 5663 |
5664 #undef __ | 5664 #undef __ |
5665 | 5665 |
5666 } } // namespace v8::internal | 5666 } } // namespace v8::internal |
5667 | 5667 |
5668 #endif // V8_TARGET_ARCH_X64 | 5668 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |