Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 21063002: Out-of-line constant pool on Arm: Stage 1 - Free up r7 for use as constant pool pointer register (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Rodolph's comments. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3878 matching lines...) Expand 10 before | Expand all | Expand 10 after
3889 ToRegister(instr->right()).is(r2)); 3889 ToRegister(instr->right()).is(r2));
3890 ASSERT(ToDoubleRegister(instr->left()).is(d1)); 3890 ASSERT(ToDoubleRegister(instr->left()).is(d1));
3891 ASSERT(ToDoubleRegister(instr->result()).is(d3)); 3891 ASSERT(ToDoubleRegister(instr->result()).is(d3));
3892 3892
3893 if (exponent_type.IsSmi()) { 3893 if (exponent_type.IsSmi()) {
3894 MathPowStub stub(MathPowStub::TAGGED); 3894 MathPowStub stub(MathPowStub::TAGGED);
3895 __ CallStub(&stub); 3895 __ CallStub(&stub);
3896 } else if (exponent_type.IsTagged()) { 3896 } else if (exponent_type.IsTagged()) {
3897 Label no_deopt; 3897 Label no_deopt;
3898 __ JumpIfSmi(r2, &no_deopt); 3898 __ JumpIfSmi(r2, &no_deopt);
3899 __ ldr(r7, FieldMemOperand(r2, HeapObject::kMapOffset)); 3899 __ ldr(r6, FieldMemOperand(r2, HeapObject::kMapOffset));
3900 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); 3900 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
3901 __ cmp(r7, Operand(ip)); 3901 __ cmp(r6, Operand(ip));
3902 DeoptimizeIf(ne, instr->environment()); 3902 DeoptimizeIf(ne, instr->environment());
3903 __ bind(&no_deopt); 3903 __ bind(&no_deopt);
3904 MathPowStub stub(MathPowStub::TAGGED); 3904 MathPowStub stub(MathPowStub::TAGGED);
3905 __ CallStub(&stub); 3905 __ CallStub(&stub);
3906 } else if (exponent_type.IsInteger32()) { 3906 } else if (exponent_type.IsInteger32()) {
3907 MathPowStub stub(MathPowStub::INTEGER); 3907 MathPowStub stub(MathPowStub::INTEGER);
3908 __ CallStub(&stub); 3908 __ CallStub(&stub);
3909 } else { 3909 } else {
3910 ASSERT(exponent_type.IsDouble()); 3910 ASSERT(exponent_type.IsDouble());
3911 MathPowStub stub(MathPowStub::DOUBLE); 3911 MathPowStub stub(MathPowStub::DOUBLE);
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
5432 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { 5432 void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
5433 ASSERT(ToRegister(instr->value()).is(r0)); 5433 ASSERT(ToRegister(instr->value()).is(r0));
5434 __ push(r0); 5434 __ push(r0);
5435 CallRuntime(Runtime::kToFastProperties, 1, instr); 5435 CallRuntime(Runtime::kToFastProperties, 1, instr);
5436 } 5436 }
5437 5437
5438 5438
5439 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { 5439 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
5440 Label materialized; 5440 Label materialized;
5441 // Registers will be used as follows: 5441 // Registers will be used as follows:
5442 // r7 = literals array. 5442 // r6 = literals array.
5443 // r1 = regexp literal. 5443 // r1 = regexp literal.
5444 // r0 = regexp literal clone. 5444 // r0 = regexp literal clone.
5445 // r2 and r4-r6 are used as temporaries. 5445 // r2-5 are used as temporaries.
5446 int literal_offset = 5446 int literal_offset =
5447 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); 5447 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index());
5448 __ LoadHeapObject(r7, instr->hydrogen()->literals()); 5448 __ LoadHeapObject(r6, instr->hydrogen()->literals());
5449 __ ldr(r1, FieldMemOperand(r7, literal_offset)); 5449 __ ldr(r1, FieldMemOperand(r6, literal_offset));
5450 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 5450 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
5451 __ cmp(r1, ip); 5451 __ cmp(r1, ip);
5452 __ b(ne, &materialized); 5452 __ b(ne, &materialized);
5453 5453
5454 // Create regexp literal using runtime function 5454 // Create regexp literal using runtime function
5455 // Result will be in r0. 5455 // Result will be in r0.
5456 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); 5456 __ mov(r5, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
5457 __ mov(r5, Operand(instr->hydrogen()->pattern())); 5457 __ mov(r4, Operand(instr->hydrogen()->pattern()));
5458 __ mov(r4, Operand(instr->hydrogen()->flags())); 5458 __ mov(r3, Operand(instr->hydrogen()->flags()));
5459 __ Push(r7, r6, r5, r4); 5459 __ Push(r6, r5, r4, r3);
5460 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); 5460 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr);
5461 __ mov(r1, r0); 5461 __ mov(r1, r0);
5462 5462
5463 __ bind(&materialized); 5463 __ bind(&materialized);
5464 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize; 5464 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize;
5465 Label allocated, runtime_allocate; 5465 Label allocated, runtime_allocate;
5466 5466
5467 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT); 5467 __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT);
5468 __ jmp(&allocated); 5468 __ jmp(&allocated);
5469 5469
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
5838 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5838 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5839 __ ldr(result, FieldMemOperand(scratch, 5839 __ ldr(result, FieldMemOperand(scratch,
5840 FixedArray::kHeaderSize - kPointerSize)); 5840 FixedArray::kHeaderSize - kPointerSize));
5841 __ bind(&done); 5841 __ bind(&done);
5842 } 5842 }
5843 5843
5844 5844
5845 #undef __ 5845 #undef __
5846 5846
5847 } } // namespace v8::internal 5847 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698