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

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

Issue 10834031: Always set the callee's context when calling a function from optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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/ia32/lithium-codegen-ia32.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 3175 matching lines...) Expand 10 before | Expand all | Expand 10 after
3186 function->shared()->formal_parameter_count() == arity; 3186 function->shared()->formal_parameter_count() == arity;
3187 3187
3188 LPointerMap* pointers = instr->pointer_map(); 3188 LPointerMap* pointers = instr->pointer_map();
3189 RecordPosition(pointers->position()); 3189 RecordPosition(pointers->position());
3190 3190
3191 if (can_invoke_directly) { 3191 if (can_invoke_directly) {
3192 if (r1_state == R1_UNINITIALIZED) { 3192 if (r1_state == R1_UNINITIALIZED) {
3193 __ LoadHeapObject(r1, function); 3193 __ LoadHeapObject(r1, function);
3194 } 3194 }
3195 3195
3196 // Change context if needed. 3196 // Change context.
3197 bool change_context = 3197 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
3198 (info()->closure()->context() != function->context()) ||
3199 scope()->contains_with() ||
3200 (scope()->num_heap_slots() > 0);
3201 if (change_context) {
3202 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
3203 }
3204 3198
3205 // Set r0 to arguments count if adaption is not needed. Assumes that r0 3199 // Set r0 to arguments count if adaption is not needed. Assumes that r0
3206 // is available to write to at this point. 3200 // is available to write to at this point.
3207 if (!function->NeedsArgumentsAdaption()) { 3201 if (!function->NeedsArgumentsAdaption()) {
3208 __ mov(r0, Operand(arity)); 3202 __ mov(r0, Operand(arity));
3209 } 3203 }
3210 3204
3211 // Invoke function. 3205 // Invoke function.
3212 __ SetCallKind(r5, call_kind); 3206 __ SetCallKind(r5, call_kind);
3213 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); 3207 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
(...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after
5447 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5441 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5448 __ ldr(result, FieldMemOperand(scratch, 5442 __ ldr(result, FieldMemOperand(scratch,
5449 FixedArray::kHeaderSize - kPointerSize)); 5443 FixedArray::kHeaderSize - kPointerSize));
5450 __ bind(&done); 5444 __ bind(&done);
5451 } 5445 }
5452 5446
5453 5447
5454 #undef __ 5448 #undef __
5455 5449
5456 } } // namespace v8::internal 5450 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698