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

Side by Side Diff: src/mips/deoptimizer-mips.cc

Issue 153983002: MIPS: Fixes for patch sites if long branches are emitted. (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 | « src/mips/codegen-mips.cc ('k') | src/mips/full-codegen-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 1
2 // Copyright 2011 the V8 project authors. All rights reserved. 2 // Copyright 2011 the V8 project authors. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following 10 // copyright notice, this list of conditions and the following
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 // the first stack slot not part of the input frame. 232 // the first stack slot not part of the input frame.
233 __ lw(a2, MemOperand(a1, FrameDescription::frame_size_offset())); 233 __ lw(a2, MemOperand(a1, FrameDescription::frame_size_offset()));
234 __ Addu(a2, a2, sp); 234 __ Addu(a2, a2, sp);
235 235
236 // Unwind the stack down to - but not including - the unwinding 236 // Unwind the stack down to - but not including - the unwinding
237 // limit and copy the contents of the activation frame to the input 237 // limit and copy the contents of the activation frame to the input
238 // frame description. 238 // frame description.
239 __ Addu(a3, a1, Operand(FrameDescription::frame_content_offset())); 239 __ Addu(a3, a1, Operand(FrameDescription::frame_content_offset()));
240 Label pop_loop; 240 Label pop_loop;
241 Label pop_loop_header; 241 Label pop_loop_header;
242 __ Branch(&pop_loop_header); 242 __ BranchShort(&pop_loop_header);
243 __ bind(&pop_loop); 243 __ bind(&pop_loop);
244 __ pop(t0); 244 __ pop(t0);
245 __ sw(t0, MemOperand(a3, 0)); 245 __ sw(t0, MemOperand(a3, 0));
246 __ addiu(a3, a3, sizeof(uint32_t)); 246 __ addiu(a3, a3, sizeof(uint32_t));
247 __ bind(&pop_loop_header); 247 __ bind(&pop_loop_header);
248 __ Branch(&pop_loop, ne, a2, Operand(sp)); 248 __ BranchShort(&pop_loop, ne, a2, Operand(sp));
249 249
250 // Compute the output frame in the deoptimizer. 250 // Compute the output frame in the deoptimizer.
251 __ push(a0); // Preserve deoptimizer object across call. 251 __ push(a0); // Preserve deoptimizer object across call.
252 // a0: deoptimizer object; a1: scratch. 252 // a0: deoptimizer object; a1: scratch.
253 __ PrepareCallCFunction(1, a1); 253 __ PrepareCallCFunction(1, a1);
254 // Call Deoptimizer::ComputeOutputFrames(). 254 // Call Deoptimizer::ComputeOutputFrames().
255 { 255 {
256 AllowExternalCallThatCantCauseGC scope(masm()); 256 AllowExternalCallThatCantCauseGC scope(masm());
257 __ CallCFunction( 257 __ CallCFunction(
258 ExternalReference::compute_output_frames_function(isolate()), 1); 258 ExternalReference::compute_output_frames_function(isolate()), 1);
(...skipping 14 matching lines...) Expand all
273 // Inner loop state: a2 = current FrameDescription*, a3 = loop index. 273 // Inner loop state: a2 = current FrameDescription*, a3 = loop index.
274 __ lw(a2, MemOperand(t0, 0)); // output_[ix] 274 __ lw(a2, MemOperand(t0, 0)); // output_[ix]
275 __ lw(a3, MemOperand(a2, FrameDescription::frame_size_offset())); 275 __ lw(a3, MemOperand(a2, FrameDescription::frame_size_offset()));
276 __ jmp(&inner_loop_header); 276 __ jmp(&inner_loop_header);
277 __ bind(&inner_push_loop); 277 __ bind(&inner_push_loop);
278 __ Subu(a3, a3, Operand(sizeof(uint32_t))); 278 __ Subu(a3, a3, Operand(sizeof(uint32_t)));
279 __ Addu(t2, a2, Operand(a3)); 279 __ Addu(t2, a2, Operand(a3));
280 __ lw(t3, MemOperand(t2, FrameDescription::frame_content_offset())); 280 __ lw(t3, MemOperand(t2, FrameDescription::frame_content_offset()));
281 __ push(t3); 281 __ push(t3);
282 __ bind(&inner_loop_header); 282 __ bind(&inner_loop_header);
283 __ Branch(&inner_push_loop, ne, a3, Operand(zero_reg)); 283 __ BranchShort(&inner_push_loop, ne, a3, Operand(zero_reg));
284 284
285 __ Addu(t0, t0, Operand(kPointerSize)); 285 __ Addu(t0, t0, Operand(kPointerSize));
286 __ bind(&outer_loop_header); 286 __ bind(&outer_loop_header);
287 __ Branch(&outer_push_loop, lt, t0, Operand(a1)); 287 __ BranchShort(&outer_push_loop, lt, t0, Operand(a1));
288 288
289 __ lw(a1, MemOperand(a0, Deoptimizer::input_offset())); 289 __ lw(a1, MemOperand(a0, Deoptimizer::input_offset()));
290 for (int i = 0; i < FPURegister::kMaxNumAllocatableRegisters; ++i) { 290 for (int i = 0; i < FPURegister::kMaxNumAllocatableRegisters; ++i) {
291 const FPURegister fpu_reg = FPURegister::FromAllocationIndex(i); 291 const FPURegister fpu_reg = FPURegister::FromAllocationIndex(i);
292 int src_offset = i * kDoubleSize + double_regs_offset; 292 int src_offset = i * kDoubleSize + double_regs_offset;
293 __ ldc1(fpu_reg, MemOperand(a1, src_offset)); 293 __ ldc1(fpu_reg, MemOperand(a1, src_offset));
294 } 294 }
295 295
296 // Push state, pc, and continuation from the last output frame. 296 // Push state, pc, and continuation from the last output frame.
297 __ lw(t2, MemOperand(a2, FrameDescription::state_offset())); 297 __ lw(t2, MemOperand(a2, FrameDescription::state_offset()));
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { 369 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
370 SetFrameSlot(offset, value); 370 SetFrameSlot(offset, value);
371 } 371 }
372 372
373 373
374 #undef __ 374 #undef __
375 375
376 376
377 } } // namespace v8::internal 377 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/codegen-mips.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698