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

Side by Side Diff: src/arm/full-codegen-arm.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/arm/code-stubs-arm.cc ('k') | src/code-stubs.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 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 // of the stack check table. 324 // of the stack check table.
325 masm()->CheckConstPool(true, false); 325 masm()->CheckConstPool(true, false);
326 } 326 }
327 327
328 328
329 void FullCodeGenerator::ClearAccumulator() { 329 void FullCodeGenerator::ClearAccumulator() {
330 __ mov(r0, Operand(Smi::FromInt(0))); 330 __ mov(r0, Operand(Smi::FromInt(0)));
331 } 331 }
332 332
333 333
334 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) { 334 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
335 Label* back_edge_target) {
335 Comment cmnt(masm_, "[ Stack check"); 336 Comment cmnt(masm_, "[ Stack check");
336 Label ok; 337 Label ok;
337 __ LoadRoot(ip, Heap::kStackLimitRootIndex); 338 __ LoadRoot(ip, Heap::kStackLimitRootIndex);
338 __ cmp(sp, Operand(ip)); 339 __ cmp(sp, Operand(ip));
339 __ b(hs, &ok); 340 __ b(hs, &ok);
340 StackCheckStub stub; 341 StackCheckStub stub;
341 __ CallStub(&stub); 342 __ CallStub(&stub);
342 // Record a mapping of this PC offset to the OSR id. This is used to find 343 // Record a mapping of this PC offset to the OSR id. This is used to find
343 // the AST id from the unoptimized code in order to use it as a key into 344 // the AST id from the unoptimized code in order to use it as a key into
344 // the deoptimization input data found in the optimized code. 345 // the deoptimization input data found in the optimized code.
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 // Generate code for the body of the loop. 1100 // Generate code for the body of the loop.
1100 Visit(stmt->body()); 1101 Visit(stmt->body());
1101 1102
1102 // Generate code for the going to the next element by incrementing 1103 // Generate code for the going to the next element by incrementing
1103 // the index (smi) stored on top of the stack. 1104 // the index (smi) stored on top of the stack.
1104 __ bind(loop_statement.continue_label()); 1105 __ bind(loop_statement.continue_label());
1105 __ pop(r0); 1106 __ pop(r0);
1106 __ add(r0, r0, Operand(Smi::FromInt(1))); 1107 __ add(r0, r0, Operand(Smi::FromInt(1)));
1107 __ push(r0); 1108 __ push(r0);
1108 1109
1109 EmitStackCheck(stmt); 1110 EmitStackCheck(stmt, &loop);
1110 __ b(&loop); 1111 __ b(&loop);
1111 1112
1112 // Remove the pointers stored on the stack. 1113 // Remove the pointers stored on the stack.
1113 __ bind(loop_statement.break_label()); 1114 __ bind(loop_statement.break_label());
1114 __ Drop(5); 1115 __ Drop(5);
1115 1116
1116 // Exit and decrement the loop depth. 1117 // Exit and decrement the loop depth.
1117 __ bind(&exit); 1118 __ bind(&exit);
1118 decrement_loop_depth(); 1119 decrement_loop_depth();
1119 } 1120 }
(...skipping 3300 matching lines...) Expand 10 before | Expand all | Expand 10 after
4420 *context_length = 0; 4421 *context_length = 0;
4421 return previous_; 4422 return previous_;
4422 } 4423 }
4423 4424
4424 4425
4425 #undef __ 4426 #undef __
4426 4427
4427 } } // namespace v8::internal 4428 } } // namespace v8::internal
4428 4429
4429 #endif // V8_TARGET_ARCH_ARM 4430 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698