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 3854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3865 ToRegister(instr->right()).is(r2)); | 3865 ToRegister(instr->right()).is(r2)); |
3866 ASSERT(ToDoubleRegister(instr->left()).is(d1)); | 3866 ASSERT(ToDoubleRegister(instr->left()).is(d1)); |
3867 ASSERT(ToDoubleRegister(instr->result()).is(d3)); | 3867 ASSERT(ToDoubleRegister(instr->result()).is(d3)); |
3868 | 3868 |
3869 if (exponent_type.IsSmi()) { | 3869 if (exponent_type.IsSmi()) { |
3870 MathPowStub stub(MathPowStub::TAGGED); | 3870 MathPowStub stub(MathPowStub::TAGGED); |
3871 __ CallStub(&stub); | 3871 __ CallStub(&stub); |
3872 } else if (exponent_type.IsTagged()) { | 3872 } else if (exponent_type.IsTagged()) { |
3873 Label no_deopt; | 3873 Label no_deopt; |
3874 __ JumpIfSmi(r2, &no_deopt); | 3874 __ JumpIfSmi(r2, &no_deopt); |
3875 __ ldr(r7, FieldMemOperand(r2, HeapObject::kMapOffset)); | 3875 __ ldr(r6, FieldMemOperand(r2, HeapObject::kMapOffset)); |
3876 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 3876 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
3877 __ cmp(r7, Operand(ip)); | 3877 __ cmp(r6, Operand(ip)); |
3878 DeoptimizeIf(ne, instr->environment()); | 3878 DeoptimizeIf(ne, instr->environment()); |
3879 __ bind(&no_deopt); | 3879 __ bind(&no_deopt); |
3880 MathPowStub stub(MathPowStub::TAGGED); | 3880 MathPowStub stub(MathPowStub::TAGGED); |
3881 __ CallStub(&stub); | 3881 __ CallStub(&stub); |
3882 } else if (exponent_type.IsInteger32()) { | 3882 } else if (exponent_type.IsInteger32()) { |
3883 MathPowStub stub(MathPowStub::INTEGER); | 3883 MathPowStub stub(MathPowStub::INTEGER); |
3884 __ CallStub(&stub); | 3884 __ CallStub(&stub); |
3885 } else { | 3885 } else { |
3886 ASSERT(exponent_type.IsDouble()); | 3886 ASSERT(exponent_type.IsDouble()); |
3887 MathPowStub stub(MathPowStub::DOUBLE); | 3887 MathPowStub stub(MathPowStub::DOUBLE); |
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5369 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5369 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
5370 ASSERT(ToRegister(instr->value()).is(r0)); | 5370 ASSERT(ToRegister(instr->value()).is(r0)); |
5371 __ push(r0); | 5371 __ push(r0); |
5372 CallRuntime(Runtime::kToFastProperties, 1, instr); | 5372 CallRuntime(Runtime::kToFastProperties, 1, instr); |
5373 } | 5373 } |
5374 | 5374 |
5375 | 5375 |
5376 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 5376 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
5377 Label materialized; | 5377 Label materialized; |
5378 // Registers will be used as follows: | 5378 // Registers will be used as follows: |
5379 // r7 = literals array. | 5379 // r6 = literals array. |
5380 // r1 = regexp literal. | 5380 // r1 = regexp literal. |
5381 // r0 = regexp literal clone. | 5381 // r0 = regexp literal clone. |
5382 // r2 and r4-r6 are used as temporaries. | 5382 // r2-5 are used as temporaries. |
5383 int literal_offset = | 5383 int literal_offset = |
5384 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); | 5384 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); |
5385 __ LoadHeapObject(r7, instr->hydrogen()->literals()); | 5385 __ LoadHeapObject(r6, instr->hydrogen()->literals()); |
5386 __ ldr(r1, FieldMemOperand(r7, literal_offset)); | 5386 __ ldr(r1, FieldMemOperand(r6, literal_offset)); |
5387 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 5387 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
5388 __ cmp(r1, ip); | 5388 __ cmp(r1, ip); |
5389 __ b(ne, &materialized); | 5389 __ b(ne, &materialized); |
5390 | 5390 |
5391 // Create regexp literal using runtime function | 5391 // Create regexp literal using runtime function |
5392 // Result will be in r0. | 5392 // Result will be in r0. |
5393 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); | 5393 __ mov(r5, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); |
5394 __ mov(r5, Operand(instr->hydrogen()->pattern())); | 5394 __ mov(r4, Operand(instr->hydrogen()->pattern())); |
5395 __ mov(r4, Operand(instr->hydrogen()->flags())); | 5395 __ mov(r3, Operand(instr->hydrogen()->flags())); |
5396 __ Push(r7, r6, r5, r4); | 5396 __ Push(r6, r5, r4, r3); |
5397 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); | 5397 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); |
5398 __ mov(r1, r0); | 5398 __ mov(r1, r0); |
5399 | 5399 |
5400 __ bind(&materialized); | 5400 __ bind(&materialized); |
5401 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; | 5401 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; |
5402 Label allocated, runtime_allocate; | 5402 Label allocated, runtime_allocate; |
5403 | 5403 |
5404 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); | 5404 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); |
5405 __ jmp(&allocated); | 5405 __ jmp(&allocated); |
5406 | 5406 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5777 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5777 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5778 __ ldr(result, FieldMemOperand(scratch, | 5778 __ ldr(result, FieldMemOperand(scratch, |
5779 FixedArray::kHeaderSize - kPointerSize)); | 5779 FixedArray::kHeaderSize - kPointerSize)); |
5780 __ bind(&done); | 5780 __ bind(&done); |
5781 } | 5781 } |
5782 | 5782 |
5783 | 5783 |
5784 #undef __ | 5784 #undef __ |
5785 | 5785 |
5786 } } // namespace v8::internal | 5786 } } // namespace v8::internal |
OLD | NEW |