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

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

Issue 10703005: Allow inlining of functions containing RegExp literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4741 matching lines...) Expand 10 before | Expand all | Expand 10 after
4752 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); 4752 ASSERT(ToRegister(instr->InputAt(0)).is(a0));
4753 ASSERT(ToRegister(instr->result()).is(v0)); 4753 ASSERT(ToRegister(instr->result()).is(v0));
4754 __ push(a0); 4754 __ push(a0);
4755 CallRuntime(Runtime::kToFastProperties, 1, instr); 4755 CallRuntime(Runtime::kToFastProperties, 1, instr);
4756 } 4756 }
4757 4757
4758 4758
4759 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { 4759 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
4760 Label materialized; 4760 Label materialized;
4761 // Registers will be used as follows: 4761 // Registers will be used as follows:
4762 // a3 = JS function.
4763 // t3 = literals array. 4762 // t3 = literals array.
4764 // a1 = regexp literal. 4763 // a1 = regexp literal.
4765 // a0 = regexp literal clone. 4764 // a0 = regexp literal clone.
4766 // a2 and t0-t2 are used as temporaries. 4765 // a2 and t0-t2 are used as temporaries.
4767 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 4766 int literal_offset =
4768 __ lw(t3, FieldMemOperand(a3, JSFunction::kLiteralsOffset)); 4767 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index());
4769 int literal_offset = FixedArray::kHeaderSize + 4768 __ LoadHeapObject(t3, instr->hydrogen()->literals());
4770 instr->hydrogen()->literal_index() * kPointerSize;
4771 __ lw(a1, FieldMemOperand(t3, literal_offset)); 4769 __ lw(a1, FieldMemOperand(t3, literal_offset));
4772 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 4770 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
4773 __ Branch(&materialized, ne, a1, Operand(at)); 4771 __ Branch(&materialized, ne, a1, Operand(at));
4774 4772
4775 // Create regexp literal using runtime function 4773 // Create regexp literal using runtime function
4776 // Result will be in v0. 4774 // Result will be in v0.
4777 __ li(t2, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); 4775 __ li(t2, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
4778 __ li(t1, Operand(instr->hydrogen()->pattern())); 4776 __ li(t1, Operand(instr->hydrogen()->pattern()));
4779 __ li(t0, Operand(instr->hydrogen()->flags())); 4777 __ li(t0, Operand(instr->hydrogen()->flags()));
4780 __ Push(t3, t2, t1, t0); 4778 __ Push(t3, t2, t1, t0);
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
5205 __ Subu(scratch, result, scratch); 5203 __ Subu(scratch, result, scratch);
5206 __ lw(result, FieldMemOperand(scratch, 5204 __ lw(result, FieldMemOperand(scratch,
5207 FixedArray::kHeaderSize - kPointerSize)); 5205 FixedArray::kHeaderSize - kPointerSize));
5208 __ bind(&done); 5206 __ bind(&done);
5209 } 5207 }
5210 5208
5211 5209
5212 #undef __ 5210 #undef __
5213 5211
5214 } } // namespace v8::internal 5212 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698