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

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 177683002: Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2252 __ Jump(lr); 2252 __ Jump(lr);
2253 2253
2254 // Slow-case: Handle non-smi or out-of-bounds access to arguments 2254 // Slow-case: Handle non-smi or out-of-bounds access to arguments
2255 // by calling the runtime system. 2255 // by calling the runtime system.
2256 __ bind(&slow); 2256 __ bind(&slow);
2257 __ push(r1); 2257 __ push(r1);
2258 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); 2258 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1);
2259 } 2259 }
2260 2260
2261 2261
2262 void ArgumentsAccessStub::GenerateNewNonStrictSlow(MacroAssembler* masm) { 2262 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) {
2263 // sp[0] : number of parameters 2263 // sp[0] : number of parameters
2264 // sp[4] : receiver displacement 2264 // sp[4] : receiver displacement
2265 // sp[8] : function 2265 // sp[8] : function
2266 2266
2267 // Check if the calling frame is an arguments adaptor frame. 2267 // Check if the calling frame is an arguments adaptor frame.
2268 Label runtime; 2268 Label runtime;
2269 __ ldr(r3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 2269 __ ldr(r3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2270 __ ldr(r2, MemOperand(r3, StandardFrameConstants::kContextOffset)); 2270 __ ldr(r2, MemOperand(r3, StandardFrameConstants::kContextOffset));
2271 __ cmp(r2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 2271 __ cmp(r2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
2272 __ b(ne, &runtime); 2272 __ b(ne, &runtime);
2273 2273
2274 // Patch the arguments.length and the parameters pointer in the current frame. 2274 // Patch the arguments.length and the parameters pointer in the current frame.
2275 __ ldr(r2, MemOperand(r3, ArgumentsAdaptorFrameConstants::kLengthOffset)); 2275 __ ldr(r2, MemOperand(r3, ArgumentsAdaptorFrameConstants::kLengthOffset));
2276 __ str(r2, MemOperand(sp, 0 * kPointerSize)); 2276 __ str(r2, MemOperand(sp, 0 * kPointerSize));
2277 __ add(r3, r3, Operand(r2, LSL, 1)); 2277 __ add(r3, r3, Operand(r2, LSL, 1));
2278 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); 2278 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset));
2279 __ str(r3, MemOperand(sp, 1 * kPointerSize)); 2279 __ str(r3, MemOperand(sp, 1 * kPointerSize));
2280 2280
2281 __ bind(&runtime); 2281 __ bind(&runtime);
2282 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); 2282 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
2283 } 2283 }
2284 2284
2285 2285
2286 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { 2286 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) {
2287 // Stack layout: 2287 // Stack layout:
2288 // sp[0] : number of parameters (tagged) 2288 // sp[0] : number of parameters (tagged)
2289 // sp[4] : address of receiver argument 2289 // sp[4] : address of receiver argument
2290 // sp[8] : function 2290 // sp[8] : function
2291 // Registers used over whole function: 2291 // Registers used over whole function:
2292 // r6 : allocated object (tagged) 2292 // r6 : allocated object (tagged)
2293 // r9 : mapped parameter count (tagged) 2293 // r9 : mapped parameter count (tagged)
2294 2294
2295 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); 2295 __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
2296 // r1 = parameter count (tagged) 2296 // r1 = parameter count (tagged)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 // r2 = argument count (tagged) 2390 // r2 = argument count (tagged)
2391 // r4 = address of parameter map or backing store (tagged) 2391 // r4 = address of parameter map or backing store (tagged)
2392 // Initialize parameter map. If there are no mapped arguments, we're done. 2392 // Initialize parameter map. If there are no mapped arguments, we're done.
2393 Label skip_parameter_map; 2393 Label skip_parameter_map;
2394 __ cmp(r1, Operand(Smi::FromInt(0))); 2394 __ cmp(r1, Operand(Smi::FromInt(0)));
2395 // Move backing store address to r3, because it is 2395 // Move backing store address to r3, because it is
2396 // expected there when filling in the unmapped arguments. 2396 // expected there when filling in the unmapped arguments.
2397 __ mov(r3, r4, LeaveCC, eq); 2397 __ mov(r3, r4, LeaveCC, eq);
2398 __ b(eq, &skip_parameter_map); 2398 __ b(eq, &skip_parameter_map);
2399 2399
2400 __ LoadRoot(r6, Heap::kNonStrictArgumentsElementsMapRootIndex); 2400 __ LoadRoot(r6, Heap::kSloppyArgumentsElementsMapRootIndex);
2401 __ str(r6, FieldMemOperand(r4, FixedArray::kMapOffset)); 2401 __ str(r6, FieldMemOperand(r4, FixedArray::kMapOffset));
2402 __ add(r6, r1, Operand(Smi::FromInt(2))); 2402 __ add(r6, r1, Operand(Smi::FromInt(2)));
2403 __ str(r6, FieldMemOperand(r4, FixedArray::kLengthOffset)); 2403 __ str(r6, FieldMemOperand(r4, FixedArray::kLengthOffset));
2404 __ str(cp, FieldMemOperand(r4, FixedArray::kHeaderSize + 0 * kPointerSize)); 2404 __ str(cp, FieldMemOperand(r4, FixedArray::kHeaderSize + 0 * kPointerSize));
2405 __ add(r6, r4, Operand(r1, LSL, 1)); 2405 __ add(r6, r4, Operand(r1, LSL, 1));
2406 __ add(r6, r6, Operand(kParameterMapHeaderSize)); 2406 __ add(r6, r6, Operand(kParameterMapHeaderSize));
2407 __ str(r6, FieldMemOperand(r4, FixedArray::kHeaderSize + 1 * kPointerSize)); 2407 __ str(r6, FieldMemOperand(r4, FixedArray::kHeaderSize + 1 * kPointerSize));
2408 2408
2409 // Copy the parameter slots and the holes in the arguments. 2409 // Copy the parameter slots and the holes in the arguments.
2410 // We need to fill in mapped_parameter_count slots. They index the context, 2410 // We need to fill in mapped_parameter_count slots. They index the context,
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
3127 __ ldr(r4, FieldMemOperand(r3, SharedFunctionInfo::kCompilerHintsOffset)); 3127 __ ldr(r4, FieldMemOperand(r3, SharedFunctionInfo::kCompilerHintsOffset));
3128 __ tst(r4, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + 3128 __ tst(r4, Operand(1 << (SharedFunctionInfo::kStrictModeFunction +
3129 kSmiTagSize))); 3129 kSmiTagSize)));
3130 __ b(ne, &cont); 3130 __ b(ne, &cont);
3131 3131
3132 // Do not transform the receiver for native (Compilerhints already in r3). 3132 // Do not transform the receiver for native (Compilerhints already in r3).
3133 __ tst(r4, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); 3133 __ tst(r4, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize)));
3134 __ b(ne, &cont); 3134 __ b(ne, &cont);
3135 } 3135 }
3136 3136
3137 // Compute the receiver in non-strict mode. 3137 // Compute the receiver in sloppy mode.
3138 __ ldr(r3, MemOperand(sp, argc_ * kPointerSize)); 3138 __ ldr(r3, MemOperand(sp, argc_ * kPointerSize));
3139 3139
3140 if (NeedsChecks()) { 3140 if (NeedsChecks()) {
3141 __ JumpIfSmi(r3, &wrap); 3141 __ JumpIfSmi(r3, &wrap);
3142 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); 3142 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE);
3143 __ b(lt, &wrap); 3143 __ b(lt, &wrap);
3144 } else { 3144 } else {
3145 __ jmp(&wrap); 3145 __ jmp(&wrap);
3146 } 3146 }
3147 3147
(...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after
5580 MemOperand(fp, 6 * kPointerSize), 5580 MemOperand(fp, 6 * kPointerSize),
5581 NULL); 5581 NULL);
5582 } 5582 }
5583 5583
5584 5584
5585 #undef __ 5585 #undef __
5586 5586
5587 } } // namespace v8::internal 5587 } } // namespace v8::internal
5588 5588
5589 #endif // V8_TARGET_ARCH_ARM 5589 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/full-codegen-arm.cc » ('j') | src/globals.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698