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 3876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3887 ToRegister(instr->right()).is(r2)); | 3887 ToRegister(instr->right()).is(r2)); |
3888 ASSERT(ToDoubleRegister(instr->left()).is(d1)); | 3888 ASSERT(ToDoubleRegister(instr->left()).is(d1)); |
3889 ASSERT(ToDoubleRegister(instr->result()).is(d3)); | 3889 ASSERT(ToDoubleRegister(instr->result()).is(d3)); |
3890 | 3890 |
3891 if (exponent_type.IsSmi()) { | 3891 if (exponent_type.IsSmi()) { |
3892 MathPowStub stub(MathPowStub::TAGGED); | 3892 MathPowStub stub(MathPowStub::TAGGED); |
3893 __ CallStub(&stub); | 3893 __ CallStub(&stub); |
3894 } else if (exponent_type.IsTagged()) { | 3894 } else if (exponent_type.IsTagged()) { |
3895 Label no_deopt; | 3895 Label no_deopt; |
3896 __ JumpIfSmi(r2, &no_deopt); | 3896 __ JumpIfSmi(r2, &no_deopt); |
3897 __ ldr(r7, FieldMemOperand(r2, HeapObject::kMapOffset)); | 3897 __ ldr(r6, FieldMemOperand(r2, HeapObject::kMapOffset)); |
3898 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 3898 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
3899 __ cmp(r7, Operand(ip)); | 3899 __ cmp(r6, Operand(ip)); |
3900 DeoptimizeIf(ne, instr->environment()); | 3900 DeoptimizeIf(ne, instr->environment()); |
3901 __ bind(&no_deopt); | 3901 __ bind(&no_deopt); |
3902 MathPowStub stub(MathPowStub::TAGGED); | 3902 MathPowStub stub(MathPowStub::TAGGED); |
3903 __ CallStub(&stub); | 3903 __ CallStub(&stub); |
3904 } else if (exponent_type.IsInteger32()) { | 3904 } else if (exponent_type.IsInteger32()) { |
3905 MathPowStub stub(MathPowStub::INTEGER); | 3905 MathPowStub stub(MathPowStub::INTEGER); |
3906 __ CallStub(&stub); | 3906 __ CallStub(&stub); |
3907 } else { | 3907 } else { |
3908 ASSERT(exponent_type.IsDouble()); | 3908 ASSERT(exponent_type.IsDouble()); |
3909 MathPowStub stub(MathPowStub::DOUBLE); | 3909 MathPowStub stub(MathPowStub::DOUBLE); |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5430 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5430 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
5431 ASSERT(ToRegister(instr->value()).is(r0)); | 5431 ASSERT(ToRegister(instr->value()).is(r0)); |
5432 __ push(r0); | 5432 __ push(r0); |
5433 CallRuntime(Runtime::kToFastProperties, 1, instr); | 5433 CallRuntime(Runtime::kToFastProperties, 1, instr); |
5434 } | 5434 } |
5435 | 5435 |
5436 | 5436 |
5437 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 5437 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
5438 Label materialized; | 5438 Label materialized; |
5439 // Registers will be used as follows: | 5439 // Registers will be used as follows: |
5440 // r7 = literals array. | 5440 // r6 = literals array. |
5441 // r1 = regexp literal. | 5441 // r1 = regexp literal. |
5442 // r0 = regexp literal clone. | 5442 // r0 = regexp literal clone. |
5443 // r2 and r4-r6 are used as temporaries. | 5443 // r2-5 are used as temporaries. |
5444 int literal_offset = | 5444 int literal_offset = |
5445 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); | 5445 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); |
5446 __ LoadHeapObject(r7, instr->hydrogen()->literals()); | 5446 __ LoadHeapObject(r6, instr->hydrogen()->literals()); |
5447 __ ldr(r1, FieldMemOperand(r7, literal_offset)); | 5447 __ ldr(r1, FieldMemOperand(r6, literal_offset)); |
5448 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 5448 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
5449 __ cmp(r1, ip); | 5449 __ cmp(r1, ip); |
5450 __ b(ne, &materialized); | 5450 __ b(ne, &materialized); |
5451 | 5451 |
5452 // Create regexp literal using runtime function | 5452 // Create regexp literal using runtime function |
5453 // Result will be in r0. | 5453 // Result will be in r0. |
5454 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); | 5454 __ mov(r5, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); |
5455 __ mov(r5, Operand(instr->hydrogen()->pattern())); | 5455 __ mov(r4, Operand(instr->hydrogen()->pattern())); |
5456 __ mov(r4, Operand(instr->hydrogen()->flags())); | 5456 __ mov(r3, Operand(instr->hydrogen()->flags())); |
5457 __ Push(r7, r6, r5, r4); | 5457 __ Push(r6, r5, r4, r3); |
5458 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); | 5458 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); |
5459 __ mov(r1, r0); | 5459 __ mov(r1, r0); |
5460 | 5460 |
5461 __ bind(&materialized); | 5461 __ bind(&materialized); |
5462 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; | 5462 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; |
5463 Label allocated, runtime_allocate; | 5463 Label allocated, runtime_allocate; |
5464 | 5464 |
5465 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); | 5465 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); |
5466 __ jmp(&allocated); | 5466 __ jmp(&allocated); |
5467 | 5467 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5836 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5836 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5837 __ ldr(result, FieldMemOperand(scratch, | 5837 __ ldr(result, FieldMemOperand(scratch, |
5838 FixedArray::kHeaderSize - kPointerSize)); | 5838 FixedArray::kHeaderSize - kPointerSize)); |
5839 __ bind(&done); | 5839 __ bind(&done); |
5840 } | 5840 } |
5841 | 5841 |
5842 | 5842 |
5843 #undef __ | 5843 #undef __ |
5844 | 5844 |
5845 } } // namespace v8::internal | 5845 } } // namespace v8::internal |
OLD | NEW |