| 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 3860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3871 ToRegister(instr->right()).is(r2)); | 3871 ToRegister(instr->right()).is(r2)); |
| 3872 ASSERT(ToDoubleRegister(instr->left()).is(d1)); | 3872 ASSERT(ToDoubleRegister(instr->left()).is(d1)); |
| 3873 ASSERT(ToDoubleRegister(instr->result()).is(d3)); | 3873 ASSERT(ToDoubleRegister(instr->result()).is(d3)); |
| 3874 | 3874 |
| 3875 if (exponent_type.IsSmi()) { | 3875 if (exponent_type.IsSmi()) { |
| 3876 MathPowStub stub(MathPowStub::TAGGED); | 3876 MathPowStub stub(MathPowStub::TAGGED); |
| 3877 __ CallStub(&stub); | 3877 __ CallStub(&stub); |
| 3878 } else if (exponent_type.IsTagged()) { | 3878 } else if (exponent_type.IsTagged()) { |
| 3879 Label no_deopt; | 3879 Label no_deopt; |
| 3880 __ JumpIfSmi(r2, &no_deopt); | 3880 __ JumpIfSmi(r2, &no_deopt); |
| 3881 __ ldr(r7, FieldMemOperand(r2, HeapObject::kMapOffset)); | 3881 __ ldr(r6, FieldMemOperand(r2, HeapObject::kMapOffset)); |
| 3882 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 3882 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
| 3883 __ cmp(r7, Operand(ip)); | 3883 __ cmp(r6, Operand(ip)); |
| 3884 DeoptimizeIf(ne, instr->environment()); | 3884 DeoptimizeIf(ne, instr->environment()); |
| 3885 __ bind(&no_deopt); | 3885 __ bind(&no_deopt); |
| 3886 MathPowStub stub(MathPowStub::TAGGED); | 3886 MathPowStub stub(MathPowStub::TAGGED); |
| 3887 __ CallStub(&stub); | 3887 __ CallStub(&stub); |
| 3888 } else if (exponent_type.IsInteger32()) { | 3888 } else if (exponent_type.IsInteger32()) { |
| 3889 MathPowStub stub(MathPowStub::INTEGER); | 3889 MathPowStub stub(MathPowStub::INTEGER); |
| 3890 __ CallStub(&stub); | 3890 __ CallStub(&stub); |
| 3891 } else { | 3891 } else { |
| 3892 ASSERT(exponent_type.IsDouble()); | 3892 ASSERT(exponent_type.IsDouble()); |
| 3893 MathPowStub stub(MathPowStub::DOUBLE); | 3893 MathPowStub stub(MathPowStub::DOUBLE); |
| (...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5423 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5423 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
| 5424 ASSERT(ToRegister(instr->value()).is(r0)); | 5424 ASSERT(ToRegister(instr->value()).is(r0)); |
| 5425 __ push(r0); | 5425 __ push(r0); |
| 5426 CallRuntime(Runtime::kToFastProperties, 1, instr); | 5426 CallRuntime(Runtime::kToFastProperties, 1, instr); |
| 5427 } | 5427 } |
| 5428 | 5428 |
| 5429 | 5429 |
| 5430 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 5430 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
| 5431 Label materialized; | 5431 Label materialized; |
| 5432 // Registers will be used as follows: | 5432 // Registers will be used as follows: |
| 5433 // r7 = literals array. | 5433 // r6 = literals array. |
| 5434 // r1 = regexp literal. | 5434 // r1 = regexp literal. |
| 5435 // r0 = regexp literal clone. | 5435 // r0 = regexp literal clone. |
| 5436 // r2 and r4-r6 are used as temporaries. | 5436 // r2-5 are used as temporaries. |
| 5437 int literal_offset = | 5437 int literal_offset = |
| 5438 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); | 5438 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); |
| 5439 __ LoadHeapObject(r7, instr->hydrogen()->literals()); | 5439 __ LoadHeapObject(r6, instr->hydrogen()->literals()); |
| 5440 __ ldr(r1, FieldMemOperand(r7, literal_offset)); | 5440 __ ldr(r1, FieldMemOperand(r6, literal_offset)); |
| 5441 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 5441 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 5442 __ cmp(r1, ip); | 5442 __ cmp(r1, ip); |
| 5443 __ b(ne, &materialized); | 5443 __ b(ne, &materialized); |
| 5444 | 5444 |
| 5445 // Create regexp literal using runtime function | 5445 // Create regexp literal using runtime function |
| 5446 // Result will be in r0. | 5446 // Result will be in r0. |
| 5447 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); | 5447 __ mov(r5, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); |
| 5448 __ mov(r5, Operand(instr->hydrogen()->pattern())); | 5448 __ mov(r4, Operand(instr->hydrogen()->pattern())); |
| 5449 __ mov(r4, Operand(instr->hydrogen()->flags())); | 5449 __ mov(r3, Operand(instr->hydrogen()->flags())); |
| 5450 __ Push(r7, r6, r5, r4); | 5450 __ Push(r6, r5, r4, r3); |
| 5451 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); | 5451 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); |
| 5452 __ mov(r1, r0); | 5452 __ mov(r1, r0); |
| 5453 | 5453 |
| 5454 __ bind(&materialized); | 5454 __ bind(&materialized); |
| 5455 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; | 5455 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; |
| 5456 Label allocated, runtime_allocate; | 5456 Label allocated, runtime_allocate; |
| 5457 | 5457 |
| 5458 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); | 5458 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); |
| 5459 __ jmp(&allocated); | 5459 __ jmp(&allocated); |
| 5460 | 5460 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5826 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5826 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5827 __ ldr(result, FieldMemOperand(scratch, | 5827 __ ldr(result, FieldMemOperand(scratch, |
| 5828 FixedArray::kHeaderSize - kPointerSize)); | 5828 FixedArray::kHeaderSize - kPointerSize)); |
| 5829 __ bind(&done); | 5829 __ bind(&done); |
| 5830 } | 5830 } |
| 5831 | 5831 |
| 5832 | 5832 |
| 5833 #undef __ | 5833 #undef __ |
| 5834 | 5834 |
| 5835 } } // namespace v8::internal | 5835 } } // namespace v8::internal |
| OLD | NEW |