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

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

Issue 151543003: Ensure we don't clobber the cell on ARM and MIPS (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
« no previous file with comments | « no previous file | src/mips/code-stubs-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 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after
3104 } 3104 }
3105 } 3105 }
3106 3106
3107 // Fast-case: Invoke the function now. 3107 // Fast-case: Invoke the function now.
3108 // r1: pushed function 3108 // r1: pushed function
3109 ParameterCount actual(argc_); 3109 ParameterCount actual(argc_);
3110 3110
3111 if (CallAsMethod()) { 3111 if (CallAsMethod()) {
3112 if (NeedsChecks()) { 3112 if (NeedsChecks()) {
3113 // Do not transform the receiver for strict mode functions. 3113 // Do not transform the receiver for strict mode functions.
3114 __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); 3114 __ ldr(r3, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
3115 __ ldr(r3, FieldMemOperand(r2, SharedFunctionInfo::kCompilerHintsOffset)); 3115 __ ldr(r4, FieldMemOperand(r3, SharedFunctionInfo::kCompilerHintsOffset));
3116 __ tst(r3, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + 3116 __ tst(r4, Operand(1 << (SharedFunctionInfo::kStrictModeFunction +
3117 kSmiTagSize))); 3117 kSmiTagSize)));
3118 __ b(ne, &cont); 3118 __ b(ne, &cont);
3119 3119
3120 // Do not transform the receiver for native (Compilerhints already in r3). 3120 // Do not transform the receiver for native (Compilerhints already in r3).
3121 __ tst(r3, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); 3121 __ tst(r4, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize)));
3122 __ b(ne, &cont); 3122 __ b(ne, &cont);
3123 } 3123 }
3124 3124
3125 // Compute the receiver in non-strict mode. 3125 // Compute the receiver in non-strict mode.
3126 __ ldr(r2, MemOperand(sp, argc_ * kPointerSize)); 3126 __ ldr(r3, MemOperand(sp, argc_ * kPointerSize));
3127 3127
3128 if (NeedsChecks()) { 3128 if (NeedsChecks()) {
3129 // r0: actual number of arguments 3129 __ JumpIfSmi(r3, &wrap);
3130 // r1: function 3130 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE);
3131 // r2: first argument
3132 __ JumpIfSmi(r2, &wrap);
3133 __ CompareObjectType(r2, r3, r3, FIRST_SPEC_OBJECT_TYPE);
3134 __ b(lt, &wrap); 3131 __ b(lt, &wrap);
3135 } else { 3132 } else {
3136 __ jmp(&wrap); 3133 __ jmp(&wrap);
3137 } 3134 }
3138 3135
3139 __ bind(&cont); 3136 __ bind(&cont);
3140 } 3137 }
3141 __ InvokeFunction(r1, actual, JUMP_FUNCTION, NullCallWrapper()); 3138 __ InvokeFunction(r1, actual, JUMP_FUNCTION, NullCallWrapper());
3142 3139
3143 if (NeedsChecks()) { 3140 if (NeedsChecks()) {
(...skipping 29 matching lines...) Expand all
3173 __ mov(r2, Operand::Zero()); 3170 __ mov(r2, Operand::Zero());
3174 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION); 3171 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION);
3175 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), 3172 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
3176 RelocInfo::CODE_TARGET); 3173 RelocInfo::CODE_TARGET);
3177 } 3174 }
3178 3175
3179 if (CallAsMethod()) { 3176 if (CallAsMethod()) {
3180 __ bind(&wrap); 3177 __ bind(&wrap);
3181 // Wrap the receiver and patch it back onto the stack. 3178 // Wrap the receiver and patch it back onto the stack.
3182 { FrameScope frame_scope(masm, StackFrame::INTERNAL); 3179 { FrameScope frame_scope(masm, StackFrame::INTERNAL);
3183 __ push(r1); 3180 __ Push(r1, r3);
3184 __ push(r2);
3185 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 3181 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
3186 __ pop(r1); 3182 __ pop(r1);
3187 } 3183 }
3188 __ str(r0, MemOperand(sp, argc_ * kPointerSize)); 3184 __ str(r0, MemOperand(sp, argc_ * kPointerSize));
3189 __ jmp(&cont); 3185 __ jmp(&cont);
3190 } 3186 }
3191 } 3187 }
3192 3188
3193 3189
3194 void CallConstructStub::Generate(MacroAssembler* masm) { 3190 void CallConstructStub::Generate(MacroAssembler* masm) {
(...skipping 2364 matching lines...) Expand 10 before | Expand all | Expand 10 after
5559 MemOperand(fp, 6 * kPointerSize), 5555 MemOperand(fp, 6 * kPointerSize),
5560 NULL); 5556 NULL);
5561 } 5557 }
5562 5558
5563 5559
5564 #undef __ 5560 #undef __
5565 5561
5566 } } // namespace v8::internal 5562 } } // namespace v8::internal
5567 5563
5568 #endif // V8_TARGET_ARCH_ARM 5564 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698