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

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

Issue 9373028: Initial support for count-based profiling (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 8 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/ia32/full-codegen-ia32.cc ('k') | src/runtime.h » ('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 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 EmitReturnSequence(); 308 EmitReturnSequence();
309 } 309 }
310 310
311 311
312 void FullCodeGenerator::ClearAccumulator() { 312 void FullCodeGenerator::ClearAccumulator() {
313 ASSERT(Smi::FromInt(0) == 0); 313 ASSERT(Smi::FromInt(0) == 0);
314 __ mov(v0, zero_reg); 314 __ mov(v0, zero_reg);
315 } 315 }
316 316
317 317
318 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) { 318 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
319 Label* back_edge_target) {
319 // The generated code is used in Deoptimizer::PatchStackCheckCodeAt so we need 320 // The generated code is used in Deoptimizer::PatchStackCheckCodeAt so we need
320 // to make sure it is constant. Branch may emit a skip-or-jump sequence 321 // to make sure it is constant. Branch may emit a skip-or-jump sequence
321 // instead of the normal Branch. It seems that the "skip" part of that 322 // instead of the normal Branch. It seems that the "skip" part of that
322 // sequence is about as long as this Branch would be so it is safe to ignore 323 // sequence is about as long as this Branch would be so it is safe to ignore
323 // that. 324 // that.
324 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); 325 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
325 Comment cmnt(masm_, "[ Stack check"); 326 Comment cmnt(masm_, "[ Stack check");
326 Label ok; 327 Label ok;
327 __ LoadRoot(t0, Heap::kStackLimitRootIndex); 328 __ LoadRoot(t0, Heap::kStackLimitRootIndex);
328 __ sltu(at, sp, t0); 329 __ sltu(at, sp, t0);
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 // Generate code for the body of the loop. 1092 // Generate code for the body of the loop.
1092 Visit(stmt->body()); 1093 Visit(stmt->body());
1093 1094
1094 // Generate code for the going to the next element by incrementing 1095 // Generate code for the going to the next element by incrementing
1095 // the index (smi) stored on top of the stack. 1096 // the index (smi) stored on top of the stack.
1096 __ bind(loop_statement.continue_label()); 1097 __ bind(loop_statement.continue_label());
1097 __ pop(a0); 1098 __ pop(a0);
1098 __ Addu(a0, a0, Operand(Smi::FromInt(1))); 1099 __ Addu(a0, a0, Operand(Smi::FromInt(1)));
1099 __ push(a0); 1100 __ push(a0);
1100 1101
1101 EmitStackCheck(stmt); 1102 EmitStackCheck(stmt, &loop);
1102 __ Branch(&loop); 1103 __ Branch(&loop);
1103 1104
1104 // Remove the pointers stored on the stack. 1105 // Remove the pointers stored on the stack.
1105 __ bind(loop_statement.break_label()); 1106 __ bind(loop_statement.break_label());
1106 __ Drop(5); 1107 __ Drop(5);
1107 1108
1108 // Exit and decrement the loop depth. 1109 // Exit and decrement the loop depth.
1109 __ bind(&exit); 1110 __ bind(&exit);
1110 decrement_loop_depth(); 1111 decrement_loop_depth();
1111 } 1112 }
(...skipping 3327 matching lines...) Expand 10 before | Expand all | Expand 10 after
4439 *context_length = 0; 4440 *context_length = 0;
4440 return previous_; 4441 return previous_;
4441 } 4442 }
4442 4443
4443 4444
4444 #undef __ 4445 #undef __
4445 4446
4446 } } // namespace v8::internal 4447 } } // namespace v8::internal
4447 4448
4448 #endif // V8_TARGET_ARCH_MIPS 4449 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698