| OLD | NEW |
| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 280 } |
| 281 VisitDeclarations(scope()->declarations()); | 281 VisitDeclarations(scope()->declarations()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 { Comment cmnt(masm_, "[ Stack check"); | 284 { Comment cmnt(masm_, "[ Stack check"); |
| 285 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 285 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
| 286 Label ok; | 286 Label ok; |
| 287 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 287 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 288 __ cmp(sp, Operand(ip)); | 288 __ cmp(sp, Operand(ip)); |
| 289 __ b(hs, &ok); | 289 __ b(hs, &ok); |
| 290 ScopedPredictableCodeSize predictable_code_size(masm_); |
| 290 StackCheckStub stub; | 291 StackCheckStub stub; |
| 291 __ CallStub(&stub); | 292 __ CallStub(&stub); |
| 292 __ bind(&ok); | 293 __ bind(&ok); |
| 293 } | 294 } |
| 294 | 295 |
| 295 { Comment cmnt(masm_, "[ Body"); | 296 { Comment cmnt(masm_, "[ Body"); |
| 296 ASSERT(loop_depth() == 0); | 297 ASSERT(loop_depth() == 0); |
| 297 VisitStatements(function()->body()); | 298 VisitStatements(function()->body()); |
| 298 ASSERT(loop_depth() == 0); | 299 ASSERT(loop_depth() == 0); |
| 299 } | 300 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 Max(1, distance / kBackEdgeDistanceUnit)); | 358 Max(1, distance / kBackEdgeDistanceUnit)); |
| 358 } | 359 } |
| 359 EmitProfilingCounterDecrement(weight); | 360 EmitProfilingCounterDecrement(weight); |
| 360 __ b(pl, &ok); | 361 __ b(pl, &ok); |
| 361 InterruptStub stub; | 362 InterruptStub stub; |
| 362 __ CallStub(&stub); | 363 __ CallStub(&stub); |
| 363 } else { | 364 } else { |
| 364 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 365 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 365 __ cmp(sp, Operand(ip)); | 366 __ cmp(sp, Operand(ip)); |
| 366 __ b(hs, &ok); | 367 __ b(hs, &ok); |
| 368 ScopedPredictableCodeSize predictable_code_size(masm_); |
| 367 StackCheckStub stub; | 369 StackCheckStub stub; |
| 368 __ CallStub(&stub); | 370 __ CallStub(&stub); |
| 369 } | 371 } |
| 370 | 372 |
| 371 // Record a mapping of this PC offset to the OSR id. This is used to find | 373 // Record a mapping of this PC offset to the OSR id. This is used to find |
| 372 // the AST id from the unoptimized code in order to use it as a key into | 374 // the AST id from the unoptimized code in order to use it as a key into |
| 373 // the deoptimization input data found in the optimized code. | 375 // the deoptimization input data found in the optimized code. |
| 374 RecordStackCheck(stmt->OsrEntryId()); | 376 RecordStackCheck(stmt->OsrEntryId()); |
| 375 | 377 |
| 376 if (FLAG_count_based_interrupts) { | 378 if (FLAG_count_based_interrupts) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 Label check_exit_codesize; | 432 Label check_exit_codesize; |
| 431 masm_->bind(&check_exit_codesize); | 433 masm_->bind(&check_exit_codesize); |
| 432 #endif | 434 #endif |
| 433 // Make sure that the constant pool is not emitted inside of the return | 435 // Make sure that the constant pool is not emitted inside of the return |
| 434 // sequence. | 436 // sequence. |
| 435 { Assembler::BlockConstPoolScope block_const_pool(masm_); | 437 { Assembler::BlockConstPoolScope block_const_pool(masm_); |
| 436 // Here we use masm_-> instead of the __ macro to avoid the code coverage | 438 // Here we use masm_-> instead of the __ macro to avoid the code coverage |
| 437 // tool from instrumenting as we rely on the code size here. | 439 // tool from instrumenting as we rely on the code size here. |
| 438 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; | 440 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; |
| 439 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 441 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
| 442 ScopedPredictableCodeSize predictable(masm_); |
| 440 __ RecordJSReturn(); | 443 __ RecordJSReturn(); |
| 441 masm_->mov(sp, fp); | 444 masm_->mov(sp, fp); |
| 442 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); | 445 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); |
| 443 masm_->add(sp, sp, Operand(sp_delta)); | 446 masm_->add(sp, sp, Operand(sp_delta)); |
| 444 masm_->Jump(lr); | 447 masm_->Jump(lr); |
| 445 } | 448 } |
| 446 | 449 |
| 447 #ifdef DEBUG | 450 #ifdef DEBUG |
| 448 // Check that the size of the code used for returning is large enough | 451 // Check that the size of the code used for returning is large enough |
| 449 // for the debugger's requirements. | 452 // for the debugger's requirements. |
| (...skipping 4079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4529 *context_length = 0; | 4532 *context_length = 0; |
| 4530 return previous_; | 4533 return previous_; |
| 4531 } | 4534 } |
| 4532 | 4535 |
| 4533 | 4536 |
| 4534 #undef __ | 4537 #undef __ |
| 4535 | 4538 |
| 4536 } } // namespace v8::internal | 4539 } } // namespace v8::internal |
| 4537 | 4540 |
| 4538 #endif // V8_TARGET_ARCH_ARM | 4541 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |