| 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 PredictableCodeSizeScope predictable(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 PredictableCodeSizeScope predictable(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 PredictableCodeSizeScope 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 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2232 EmitKeyedPropertyLoad(expr); | 2235 EmitKeyedPropertyLoad(expr); |
| 2233 context()->Plug(r0); | 2236 context()->Plug(r0); |
| 2234 } | 2237 } |
| 2235 } | 2238 } |
| 2236 | 2239 |
| 2237 | 2240 |
| 2238 void FullCodeGenerator::CallIC(Handle<Code> code, | 2241 void FullCodeGenerator::CallIC(Handle<Code> code, |
| 2239 RelocInfo::Mode rmode, | 2242 RelocInfo::Mode rmode, |
| 2240 TypeFeedbackId ast_id) { | 2243 TypeFeedbackId ast_id) { |
| 2241 ic_total_count_++; | 2244 ic_total_count_++; |
| 2242 __ Call(code, rmode, ast_id); | 2245 // All calls must have a predictable size in full-codegen code to ensure that |
| 2246 // the debugger can patch them correctly. |
| 2247 __ Call(code, rmode, ast_id, al, NEVER_INLINE_TARGET_ADDRESS); |
| 2243 } | 2248 } |
| 2244 | 2249 |
| 2245 void FullCodeGenerator::EmitCallWithIC(Call* expr, | 2250 void FullCodeGenerator::EmitCallWithIC(Call* expr, |
| 2246 Handle<Object> name, | 2251 Handle<Object> name, |
| 2247 RelocInfo::Mode mode) { | 2252 RelocInfo::Mode mode) { |
| 2248 // Code common for calls using the IC. | 2253 // Code common for calls using the IC. |
| 2249 ZoneList<Expression*>* args = expr->arguments(); | 2254 ZoneList<Expression*>* args = expr->arguments(); |
| 2250 int arg_count = args->length(); | 2255 int arg_count = args->length(); |
| 2251 { PreservePositionScope scope(masm()->positions_recorder()); | 2256 { PreservePositionScope scope(masm()->positions_recorder()); |
| 2252 for (int i = 0; i < arg_count; i++) { | 2257 for (int i = 0; i < arg_count; i++) { |
| (...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4528 *context_length = 0; | 4533 *context_length = 0; |
| 4529 return previous_; | 4534 return previous_; |
| 4530 } | 4535 } |
| 4531 | 4536 |
| 4532 | 4537 |
| 4533 #undef __ | 4538 #undef __ |
| 4534 | 4539 |
| 4535 } } // namespace v8::internal | 4540 } } // namespace v8::internal |
| 4536 | 4541 |
| 4537 #endif // V8_TARGET_ARCH_ARM | 4542 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |