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

Side by Side Diff: src/arm/lithium-codegen-arm.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 | « no previous file | src/ast.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 4969 matching lines...) Expand 10 before | Expand all | Expand 10 after
4980 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { 4980 void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
4981 ASSERT(ToRegister(instr->InputAt(0)).is(r0)); 4981 ASSERT(ToRegister(instr->InputAt(0)).is(r0));
4982 __ push(r0); 4982 __ push(r0);
4983 CallRuntime(Runtime::kToFastProperties, 1, instr); 4983 CallRuntime(Runtime::kToFastProperties, 1, instr);
4984 } 4984 }
4985 4985
4986 4986
4987 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { 4987 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
4988 Label materialized; 4988 Label materialized;
4989 // Registers will be used as follows: 4989 // Registers will be used as follows:
4990 // r3 = JS function.
4991 // r7 = literals array. 4990 // r7 = literals array.
4992 // r1 = regexp literal. 4991 // r1 = regexp literal.
4993 // r0 = regexp literal clone. 4992 // r0 = regexp literal clone.
4994 // r2 and r4-r6 are used as temporaries. 4993 // r2 and r4-r6 are used as temporaries.
4995 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 4994 int literal_offset =
4996 __ ldr(r7, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); 4995 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index());
4997 int literal_offset = FixedArray::kHeaderSize + 4996 __ LoadHeapObject(r7, instr->hydrogen()->literals());
4998 instr->hydrogen()->literal_index() * kPointerSize;
4999 __ ldr(r1, FieldMemOperand(r7, literal_offset)); 4997 __ ldr(r1, FieldMemOperand(r7, literal_offset));
5000 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 4998 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
5001 __ cmp(r1, ip); 4999 __ cmp(r1, ip);
5002 __ b(ne, &materialized); 5000 __ b(ne, &materialized);
5003 5001
5004 // Create regexp literal using runtime function 5002 // Create regexp literal using runtime function
5005 // Result will be in r0. 5003 // Result will be in r0.
5006 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); 5004 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
5007 __ mov(r5, Operand(instr->hydrogen()->pattern())); 5005 __ mov(r5, Operand(instr->hydrogen()->pattern()));
5008 __ mov(r4, Operand(instr->hydrogen()->flags())); 5006 __ mov(r4, Operand(instr->hydrogen()->flags()));
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
5400 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5398 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5401 __ ldr(result, FieldMemOperand(scratch, 5399 __ ldr(result, FieldMemOperand(scratch,
5402 FixedArray::kHeaderSize - kPointerSize)); 5400 FixedArray::kHeaderSize - kPointerSize));
5403 __ bind(&done); 5401 __ bind(&done);
5404 } 5402 }
5405 5403
5406 5404
5407 #undef __ 5405 #undef __
5408 5406
5409 } } // namespace v8::internal 5407 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698