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 3861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3872 ToRegister(instr->right()).is(r2)); | 3872 ToRegister(instr->right()).is(r2)); |
3873 ASSERT(ToDoubleRegister(instr->left()).is(d1)); | 3873 ASSERT(ToDoubleRegister(instr->left()).is(d1)); |
3874 ASSERT(ToDoubleRegister(instr->result()).is(d3)); | 3874 ASSERT(ToDoubleRegister(instr->result()).is(d3)); |
3875 | 3875 |
3876 if (exponent_type.IsSmi()) { | 3876 if (exponent_type.IsSmi()) { |
3877 MathPowStub stub(MathPowStub::TAGGED); | 3877 MathPowStub stub(MathPowStub::TAGGED); |
3878 __ CallStub(&stub); | 3878 __ CallStub(&stub); |
3879 } else if (exponent_type.IsTagged()) { | 3879 } else if (exponent_type.IsTagged()) { |
3880 Label no_deopt; | 3880 Label no_deopt; |
3881 __ JumpIfSmi(r2, &no_deopt); | 3881 __ JumpIfSmi(r2, &no_deopt); |
3882 __ ldr(r7, FieldMemOperand(r2, HeapObject::kMapOffset)); | 3882 __ ldr(r6, FieldMemOperand(r2, HeapObject::kMapOffset)); |
3883 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 3883 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
3884 __ cmp(r7, Operand(ip)); | 3884 __ cmp(r6, Operand(ip)); |
3885 DeoptimizeIf(ne, instr->environment()); | 3885 DeoptimizeIf(ne, instr->environment()); |
3886 __ bind(&no_deopt); | 3886 __ bind(&no_deopt); |
3887 MathPowStub stub(MathPowStub::TAGGED); | 3887 MathPowStub stub(MathPowStub::TAGGED); |
3888 __ CallStub(&stub); | 3888 __ CallStub(&stub); |
3889 } else if (exponent_type.IsInteger32()) { | 3889 } else if (exponent_type.IsInteger32()) { |
3890 MathPowStub stub(MathPowStub::INTEGER); | 3890 MathPowStub stub(MathPowStub::INTEGER); |
3891 __ CallStub(&stub); | 3891 __ CallStub(&stub); |
3892 } else { | 3892 } else { |
3893 ASSERT(exponent_type.IsDouble()); | 3893 ASSERT(exponent_type.IsDouble()); |
3894 MathPowStub stub(MathPowStub::DOUBLE); | 3894 MathPowStub stub(MathPowStub::DOUBLE); |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5379 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5379 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
5380 ASSERT(ToRegister(instr->value()).is(r0)); | 5380 ASSERT(ToRegister(instr->value()).is(r0)); |
5381 __ push(r0); | 5381 __ push(r0); |
5382 CallRuntime(Runtime::kToFastProperties, 1, instr); | 5382 CallRuntime(Runtime::kToFastProperties, 1, instr); |
5383 } | 5383 } |
5384 | 5384 |
5385 | 5385 |
5386 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 5386 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
5387 Label materialized; | 5387 Label materialized; |
5388 // Registers will be used as follows: | 5388 // Registers will be used as follows: |
5389 // r7 = literals array. | 5389 // r6 = literals array. |
5390 // r1 = regexp literal. | 5390 // r1 = regexp literal. |
5391 // r0 = regexp literal clone. | 5391 // r0 = regexp literal clone. |
5392 // r2 and r4-r6 are used as temporaries. | 5392 // r2-5 are used as temporaries. |
5393 int literal_offset = | 5393 int literal_offset = |
5394 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); | 5394 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); |
5395 __ LoadHeapObject(r7, instr->hydrogen()->literals()); | 5395 __ LoadHeapObject(r6, instr->hydrogen()->literals()); |
5396 __ ldr(r1, FieldMemOperand(r7, literal_offset)); | 5396 __ ldr(r1, FieldMemOperand(r6, literal_offset)); |
5397 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 5397 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
5398 __ cmp(r1, ip); | 5398 __ cmp(r1, ip); |
5399 __ b(ne, &materialized); | 5399 __ b(ne, &materialized); |
5400 | 5400 |
5401 // Create regexp literal using runtime function | 5401 // Create regexp literal using runtime function |
5402 // Result will be in r0. | 5402 // Result will be in r0. |
5403 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); | 5403 __ mov(r5, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); |
5404 __ mov(r5, Operand(instr->hydrogen()->pattern())); | 5404 __ mov(r4, Operand(instr->hydrogen()->pattern())); |
5405 __ mov(r4, Operand(instr->hydrogen()->flags())); | 5405 __ mov(r3, Operand(instr->hydrogen()->flags())); |
5406 __ Push(r7, r6, r5, r4); | 5406 __ Push(r6, r5, r4, r3); |
5407 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); | 5407 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); |
5408 __ mov(r1, r0); | 5408 __ mov(r1, r0); |
5409 | 5409 |
5410 __ bind(&materialized); | 5410 __ bind(&materialized); |
5411 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; | 5411 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; |
5412 Label allocated, runtime_allocate; | 5412 Label allocated, runtime_allocate; |
5413 | 5413 |
5414 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); | 5414 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); |
5415 __ jmp(&allocated); | 5415 __ jmp(&allocated); |
5416 | 5416 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5787 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5787 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5788 __ ldr(result, FieldMemOperand(scratch, | 5788 __ ldr(result, FieldMemOperand(scratch, |
5789 FixedArray::kHeaderSize - kPointerSize)); | 5789 FixedArray::kHeaderSize - kPointerSize)); |
5790 __ bind(&done); | 5790 __ bind(&done); |
5791 } | 5791 } |
5792 | 5792 |
5793 | 5793 |
5794 #undef __ | 5794 #undef __ |
5795 | 5795 |
5796 } } // namespace v8::internal | 5796 } } // namespace v8::internal |
OLD | NEW |