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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/hydrogen-instructions.h ('k') | src/mips/lithium-codegen-mips.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 4912 matching lines...) Expand 10 before | Expand all | Expand 10 after
4923 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); 4923 ASSERT(ToRegister(instr->InputAt(0)).is(eax));
4924 __ push(eax); 4924 __ push(eax);
4925 CallRuntime(Runtime::kToFastProperties, 1, instr); 4925 CallRuntime(Runtime::kToFastProperties, 1, instr);
4926 } 4926 }
4927 4927
4928 4928
4929 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { 4929 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
4930 ASSERT(ToRegister(instr->context()).is(esi)); 4930 ASSERT(ToRegister(instr->context()).is(esi));
4931 Label materialized; 4931 Label materialized;
4932 // Registers will be used as follows: 4932 // Registers will be used as follows:
4933 // edi = JS function.
4934 // ecx = literals array. 4933 // ecx = literals array.
4935 // ebx = regexp literal. 4934 // ebx = regexp literal.
4936 // eax = regexp literal clone. 4935 // eax = regexp literal clone.
4937 // esi = context. 4936 // esi = context.
4938 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 4937 int literal_offset =
4939 __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset)); 4938 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index());
4940 int literal_offset = FixedArray::kHeaderSize + 4939 __ LoadHeapObject(ecx, instr->hydrogen()->literals());
4941 instr->hydrogen()->literal_index() * kPointerSize;
4942 __ mov(ebx, FieldOperand(ecx, literal_offset)); 4940 __ mov(ebx, FieldOperand(ecx, literal_offset));
4943 __ cmp(ebx, factory()->undefined_value()); 4941 __ cmp(ebx, factory()->undefined_value());
4944 __ j(not_equal, &materialized, Label::kNear); 4942 __ j(not_equal, &materialized, Label::kNear);
4945 4943
4946 // Create regexp literal using runtime function 4944 // Create regexp literal using runtime function
4947 // Result will be in eax. 4945 // Result will be in eax.
4948 __ push(ecx); 4946 __ push(ecx);
4949 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); 4947 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
4950 __ push(Immediate(instr->hydrogen()->pattern())); 4948 __ push(Immediate(instr->hydrogen()->pattern()));
4951 __ push(Immediate(instr->hydrogen()->flags())); 4949 __ push(Immediate(instr->hydrogen()->flags()));
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
5335 FixedArray::kHeaderSize - kPointerSize)); 5333 FixedArray::kHeaderSize - kPointerSize));
5336 __ bind(&done); 5334 __ bind(&done);
5337 } 5335 }
5338 5336
5339 5337
5340 #undef __ 5338 #undef __
5341 5339
5342 } } // namespace v8::internal 5340 } } // namespace v8::internal
5343 5341
5344 #endif // V8_TARGET_ARCH_IA32 5342 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698