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

Side by Side Diff: src/mips/lithium-codegen-mips.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, 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/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-codegen-x64.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 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 function->shared()->formal_parameter_count() == arity; 2900 function->shared()->formal_parameter_count() == arity;
2901 2901
2902 LPointerMap* pointers = instr->pointer_map(); 2902 LPointerMap* pointers = instr->pointer_map();
2903 RecordPosition(pointers->position()); 2903 RecordPosition(pointers->position());
2904 2904
2905 if (can_invoke_directly) { 2905 if (can_invoke_directly) {
2906 if (a1_state == A1_UNINITIALIZED) { 2906 if (a1_state == A1_UNINITIALIZED) {
2907 __ LoadHeapObject(a1, function); 2907 __ LoadHeapObject(a1, function);
2908 } 2908 }
2909 2909
2910 // Change context if needed. 2910 // Change context.
2911 bool change_context = 2911 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
2912 (info()->closure()->context() != function->context()) ||
2913 scope()->contains_with() ||
2914 (scope()->num_heap_slots() > 0);
2915 if (change_context) {
2916 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
2917 }
2918 2912
2919 // Set r0 to arguments count if adaption is not needed. Assumes that r0 2913 // Set r0 to arguments count if adaption is not needed. Assumes that r0
2920 // is available to write to at this point. 2914 // is available to write to at this point.
2921 if (!function->NeedsArgumentsAdaption()) { 2915 if (!function->NeedsArgumentsAdaption()) {
2922 __ li(a0, Operand(arity)); 2916 __ li(a0, Operand(arity));
2923 } 2917 }
2924 2918
2925 // Invoke function. 2919 // Invoke function.
2926 __ SetCallKind(t1, call_kind); 2920 __ SetCallKind(t1, call_kind);
2927 __ lw(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); 2921 __ lw(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset));
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after
5207 __ Subu(scratch, result, scratch); 5201 __ Subu(scratch, result, scratch);
5208 __ lw(result, FieldMemOperand(scratch, 5202 __ lw(result, FieldMemOperand(scratch,
5209 FixedArray::kHeaderSize - kPointerSize)); 5203 FixedArray::kHeaderSize - kPointerSize));
5210 __ bind(&done); 5204 __ bind(&done);
5211 } 5205 }
5212 5206
5213 5207
5214 #undef __ 5208 #undef __
5215 5209
5216 } } // namespace v8::internal 5210 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698