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

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

Issue 5965014: ARM: support regexp literals in lithium-codegen-arm. Also, update... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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/arm/macro-assembler-arm.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 // Pick the right runtime function to call. 2217 // Pick the right runtime function to call.
2218 if (instr->hydrogen()->depth() > 1) { 2218 if (instr->hydrogen()->depth() > 1) {
2219 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); 2219 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
2220 } else { 2220 } else {
2221 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); 2221 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
2222 } 2222 }
2223 } 2223 }
2224 2224
2225 2225
2226 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { 2226 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
2227 Abort("DoRegExpLiteral unimplemented."); 2227 Label materialized;
2228 // Registers will be used as follows:
2229 // r3 = JS function.
2230 // r7 = literals array.
2231 // r1 = regexp literal.
2232 // r0 = regexp literal clone.
Søren Thygesen Gjesse 2011/01/05 21:58:55 Maybe mention that r2 and r4 - r6 are used as temp
2233 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
2234 __ ldr(r7, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
2235 int literal_offset = FixedArray::kHeaderSize +
2236 instr->hydrogen()->literal_index() * kPointerSize;
2237 __ ldr(r1, FieldMemOperand(r7, literal_offset));
2238 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
2239 __ cmp(r1, ip);
2240 __ b(ne, &materialized);
2241
2242 // Create regexp literal using runtime function
2243 // Result will be in r0.
2244 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
2245 __ mov(r5, Operand(instr->hydrogen()->pattern()));
2246 __ mov(r4, Operand(instr->hydrogen()->flags()));
2247 __ Push(r7, r6, r5, r4);
2248 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr);
2249 __ mov(r1, r0);
2250
2251 __ bind(&materialized);
2252 int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize;
2253 Label allocated, runtime_allocate;
2254
2255 __ AllocateInNewSpace(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT);
2256 __ jmp(&allocated);
2257
2258 __ bind(&runtime_allocate);
2259 __ mov(r0, Operand(Smi::FromInt(size)));
2260 __ Push(r1, r0);
2261 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr);
2262 __ pop(r1);
2263
2264 __ bind(&allocated);
2265 // Copy the content into the newly allocated memory.
2266 // (Unroll copy loop once for better throughput).
2267 for (int i = 0; i < size - kPointerSize; i += 2 * kPointerSize) {
2268 __ ldr(r3, FieldMemOperand(r1, i));
2269 __ ldr(r2, FieldMemOperand(r1, i + kPointerSize));
2270 __ str(r3, FieldMemOperand(r0, i));
2271 __ str(r2, FieldMemOperand(r0, i + kPointerSize));
2272 }
2273 if ((size % (2 * kPointerSize)) != 0) {
2274 __ ldr(r3, FieldMemOperand(r1, size - kPointerSize));
2275 __ str(r3, FieldMemOperand(r0, size - kPointerSize));
2276 }
2228 } 2277 }
2229 2278
2230 2279
2231 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { 2280 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
2232 Abort("DoFunctionLiteral unimplemented."); 2281 Abort("DoFunctionLiteral unimplemented.");
2233 } 2282 }
2234 2283
2235 2284
2236 void LCodeGen::DoTypeof(LTypeof* instr) { 2285 void LCodeGen::DoTypeof(LTypeof* instr) {
2237 Abort("DoTypeof unimplemented."); 2286 Abort("DoTypeof unimplemented.");
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
2370 2419
2371 2420
2372 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 2421 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
2373 Abort("DoOsrEntry unimplemented."); 2422 Abort("DoOsrEntry unimplemented.");
2374 } 2423 }
2375 2424
2376 2425
2377 #undef __ 2426 #undef __
2378 2427
2379 } } // namespace v8::internal 2428 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698