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

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

Issue 145853002: Merged r18783, r18784 into trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 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 | « src/mips/full-codegen-mips.cc ('k') | src/mips/stub-cache-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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 if (info()->saves_caller_doubles()) { 198 if (info()->saves_caller_doubles()) {
199 SaveCallerDoubles(); 199 SaveCallerDoubles();
200 } 200 }
201 201
202 // Possibly allocate a local context. 202 // Possibly allocate a local context.
203 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 203 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
204 if (heap_slots > 0) { 204 if (heap_slots > 0) {
205 Comment(";;; Allocate local context"); 205 Comment(";;; Allocate local context");
206 // Argument to NewContext is the function, which is in a1. 206 // Argument to NewContext is the function, which is in a1.
207 __ push(a1);
208 if (heap_slots <= FastNewContextStub::kMaximumSlots) { 207 if (heap_slots <= FastNewContextStub::kMaximumSlots) {
209 FastNewContextStub stub(heap_slots); 208 FastNewContextStub stub(heap_slots);
210 __ CallStub(&stub); 209 __ CallStub(&stub);
211 } else { 210 } else {
211 __ push(a1);
212 __ CallRuntime(Runtime::kNewFunctionContext, 1); 212 __ CallRuntime(Runtime::kNewFunctionContext, 1);
213 } 213 }
214 RecordSafepoint(Safepoint::kNoLazyDeopt); 214 RecordSafepoint(Safepoint::kNoLazyDeopt);
215 // Context is returned in both v0 and cp. It replaces the context 215 // Context is returned in both v0. It replaces the context passed to us.
216 // passed to us. It's saved in the stack and kept live in cp. 216 // It's saved in the stack and kept live in cp.
217 __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 217 __ mov(cp, v0);
218 __ sw(v0, MemOperand(fp, StandardFrameConstants::kContextOffset));
218 // Copy any necessary parameters into the context. 219 // Copy any necessary parameters into the context.
219 int num_parameters = scope()->num_parameters(); 220 int num_parameters = scope()->num_parameters();
220 for (int i = 0; i < num_parameters; i++) { 221 for (int i = 0; i < num_parameters; i++) {
221 Variable* var = scope()->parameter(i); 222 Variable* var = scope()->parameter(i);
222 if (var->IsContextSlot()) { 223 if (var->IsContextSlot()) {
223 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 224 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
224 (num_parameters - 1 - i) * kPointerSize; 225 (num_parameters - 1 - i) * kPointerSize;
225 // Load parameter from stack. 226 // Load parameter from stack.
226 __ lw(a0, MemOperand(fp, parameter_offset)); 227 __ lw(a0, MemOperand(fp, parameter_offset));
227 // Store it in the context. 228 // Store it in the context.
(...skipping 5587 matching lines...) Expand 10 before | Expand all | Expand 10 after
5815 __ Subu(scratch, result, scratch); 5816 __ Subu(scratch, result, scratch);
5816 __ lw(result, FieldMemOperand(scratch, 5817 __ lw(result, FieldMemOperand(scratch,
5817 FixedArray::kHeaderSize - kPointerSize)); 5818 FixedArray::kHeaderSize - kPointerSize));
5818 __ bind(&done); 5819 __ bind(&done);
5819 } 5820 }
5820 5821
5821 5822
5822 #undef __ 5823 #undef __
5823 5824
5824 } } // namespace v8::internal 5825 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698