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

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

Issue 11348195: PredictableCodeSizeScope checks the expected size now. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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/arm/lithium-codegen-arm.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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 283 }
284 VisitDeclarations(scope()->declarations()); 284 VisitDeclarations(scope()->declarations());
285 } 285 }
286 286
287 { Comment cmnt(masm_, "[ Stack check"); 287 { Comment cmnt(masm_, "[ Stack check");
288 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); 288 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS);
289 Label ok; 289 Label ok;
290 __ LoadRoot(ip, Heap::kStackLimitRootIndex); 290 __ LoadRoot(ip, Heap::kStackLimitRootIndex);
291 __ cmp(sp, Operand(ip)); 291 __ cmp(sp, Operand(ip));
292 __ b(hs, &ok); 292 __ b(hs, &ok);
293 PredictableCodeSizeScope predictable(masm_); 293 PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize);
294 StackCheckStub stub; 294 StackCheckStub stub;
295 __ CallStub(&stub); 295 __ CallStub(&stub);
296 __ bind(&ok); 296 __ bind(&ok);
297 } 297 }
298 298
299 { Comment cmnt(masm_, "[ Body"); 299 { Comment cmnt(masm_, "[ Body");
300 ASSERT(loop_depth() == 0); 300 ASSERT(loop_depth() == 0);
301 VisitStatements(function()->body()); 301 VisitStatements(function()->body());
302 ASSERT(loop_depth() == 0); 302 ASSERT(loop_depth() == 0);
303 } 303 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 Max(1, distance / kBackEdgeDistanceUnit)); 361 Max(1, distance / kBackEdgeDistanceUnit));
362 } 362 }
363 EmitProfilingCounterDecrement(weight); 363 EmitProfilingCounterDecrement(weight);
364 __ b(pl, &ok); 364 __ b(pl, &ok);
365 InterruptStub stub; 365 InterruptStub stub;
366 __ CallStub(&stub); 366 __ CallStub(&stub);
367 } else { 367 } else {
368 __ LoadRoot(ip, Heap::kStackLimitRootIndex); 368 __ LoadRoot(ip, Heap::kStackLimitRootIndex);
369 __ cmp(sp, Operand(ip)); 369 __ cmp(sp, Operand(ip));
370 __ b(hs, &ok); 370 __ b(hs, &ok);
371 PredictableCodeSizeScope predictable(masm_); 371 PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize);
372 StackCheckStub stub; 372 StackCheckStub stub;
373 __ CallStub(&stub); 373 __ CallStub(&stub);
374 } 374 }
375 375
376 // Record a mapping of this PC offset to the OSR id. This is used to find 376 // Record a mapping of this PC offset to the OSR id. This is used to find
377 // the AST id from the unoptimized code in order to use it as a key into 377 // the AST id from the unoptimized code in order to use it as a key into
378 // the deoptimization input data found in the optimized code. 378 // the deoptimization input data found in the optimized code.
379 RecordStackCheck(stmt->OsrEntryId()); 379 RecordStackCheck(stmt->OsrEntryId());
380 380
381 if (FLAG_count_based_interrupts) { 381 if (FLAG_count_based_interrupts) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 Label check_exit_codesize; 435 Label check_exit_codesize;
436 masm_->bind(&check_exit_codesize); 436 masm_->bind(&check_exit_codesize);
437 #endif 437 #endif
438 // Make sure that the constant pool is not emitted inside of the return 438 // Make sure that the constant pool is not emitted inside of the return
439 // sequence. 439 // sequence.
440 { Assembler::BlockConstPoolScope block_const_pool(masm_); 440 { Assembler::BlockConstPoolScope block_const_pool(masm_);
441 // Here we use masm_-> instead of the __ macro to avoid the code coverage 441 // Here we use masm_-> instead of the __ macro to avoid the code coverage
442 // tool from instrumenting as we rely on the code size here. 442 // tool from instrumenting as we rely on the code size here.
443 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; 443 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize;
444 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); 444 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1);
445 PredictableCodeSizeScope predictable(masm_); 445 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5!
446 PredictableCodeSizeScope predictable(masm_, -1);
446 __ RecordJSReturn(); 447 __ RecordJSReturn();
447 masm_->mov(sp, fp); 448 masm_->mov(sp, fp);
448 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); 449 masm_->ldm(ia_w, sp, fp.bit() | lr.bit());
449 masm_->add(sp, sp, Operand(sp_delta)); 450 masm_->add(sp, sp, Operand(sp_delta));
450 masm_->Jump(lr); 451 masm_->Jump(lr);
451 } 452 }
452 453
453 #ifdef DEBUG 454 #ifdef DEBUG
454 // Check that the size of the code used for returning is large enough 455 // Check that the size of the code used for returning is large enough
455 // for the debugger's requirements. 456 // for the debugger's requirements.
(...skipping 4072 matching lines...) Expand 10 before | Expand all | Expand 10 after
4528 *context_length = 0; 4529 *context_length = 0;
4529 return previous_; 4530 return previous_;
4530 } 4531 }
4531 4532
4532 4533
4533 #undef __ 4534 #undef __
4534 4535
4535 } } // namespace v8::internal 4536 } } // namespace v8::internal
4536 4537
4537 #endif // V8_TARGET_ARCH_ARM 4538 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698