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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 VisitDeclarations(scope()->declarations()); | 289 VisitDeclarations(scope()->declarations()); |
290 } | 290 } |
291 | 291 |
292 { Comment cmnt(masm_, "[ Stack check"); | 292 { Comment cmnt(masm_, "[ Stack check"); |
293 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 293 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
294 Label ok; | 294 Label ok; |
295 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 295 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
296 __ cmp(sp, Operand(ip)); | 296 __ cmp(sp, Operand(ip)); |
297 __ b(hs, &ok); | 297 __ b(hs, &ok); |
298 PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize); | 298 PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize); |
299 StackCheckStub stub; | 299 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); |
300 __ CallStub(&stub); | |
301 __ bind(&ok); | 300 __ bind(&ok); |
302 } | 301 } |
303 | 302 |
304 { Comment cmnt(masm_, "[ Body"); | 303 { Comment cmnt(masm_, "[ Body"); |
305 ASSERT(loop_depth() == 0); | 304 ASSERT(loop_depth() == 0); |
306 VisitStatements(function()->body()); | 305 VisitStatements(function()->body()); |
307 ASSERT(loop_depth() == 0); | 306 ASSERT(loop_depth() == 0); |
308 } | 307 } |
309 } | 308 } |
310 | 309 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 358 |
360 int weight = 1; | 359 int weight = 1; |
361 if (FLAG_weighted_back_edges) { | 360 if (FLAG_weighted_back_edges) { |
362 ASSERT(back_edge_target->is_bound()); | 361 ASSERT(back_edge_target->is_bound()); |
363 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target); | 362 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target); |
364 weight = Min(kMaxBackEdgeWeight, | 363 weight = Min(kMaxBackEdgeWeight, |
365 Max(1, distance / kCodeSizeMultiplier)); | 364 Max(1, distance / kCodeSizeMultiplier)); |
366 } | 365 } |
367 EmitProfilingCounterDecrement(weight); | 366 EmitProfilingCounterDecrement(weight); |
368 __ b(pl, &ok); | 367 __ b(pl, &ok); |
369 InterruptStub stub; | 368 __ Call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET); |
370 __ CallStub(&stub); | |
371 | 369 |
372 // Record a mapping of this PC offset to the OSR id. This is used to find | 370 // Record a mapping of this PC offset to the OSR id. This is used to find |
373 // the AST id from the unoptimized code in order to use it as a key into | 371 // the AST id from the unoptimized code in order to use it as a key into |
374 // the deoptimization input data found in the optimized code. | 372 // the deoptimization input data found in the optimized code. |
375 RecordBackEdge(stmt->OsrEntryId()); | 373 RecordBackEdge(stmt->OsrEntryId()); |
376 | 374 |
377 EmitProfilingCounterReset(); | 375 EmitProfilingCounterReset(); |
378 | 376 |
379 __ bind(&ok); | 377 __ bind(&ok); |
380 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); | 378 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); |
(...skipping 28 matching lines...) Expand all Loading... |
409 } | 407 } |
410 EmitProfilingCounterDecrement(weight); | 408 EmitProfilingCounterDecrement(weight); |
411 Label ok; | 409 Label ok; |
412 __ b(pl, &ok); | 410 __ b(pl, &ok); |
413 __ push(r0); | 411 __ push(r0); |
414 if (info_->ShouldSelfOptimize() && FLAG_direct_self_opt) { | 412 if (info_->ShouldSelfOptimize() && FLAG_direct_self_opt) { |
415 __ ldr(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 413 __ ldr(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
416 __ push(r2); | 414 __ push(r2); |
417 __ CallRuntime(Runtime::kOptimizeFunctionOnNextCall, 1); | 415 __ CallRuntime(Runtime::kOptimizeFunctionOnNextCall, 1); |
418 } else { | 416 } else { |
419 InterruptStub stub; | 417 __ Call(isolate()->builtins()->InterruptCheck(), |
420 __ CallStub(&stub); | 418 RelocInfo::CODE_TARGET); |
421 } | 419 } |
422 __ pop(r0); | 420 __ pop(r0); |
423 EmitProfilingCounterReset(); | 421 EmitProfilingCounterReset(); |
424 __ bind(&ok); | 422 __ bind(&ok); |
425 } | 423 } |
426 | 424 |
427 #ifdef DEBUG | 425 #ifdef DEBUG |
428 // Add a label for checking the size of the code used for returning. | 426 // Add a label for checking the size of the code used for returning. |
429 Label check_exit_codesize; | 427 Label check_exit_codesize; |
430 masm_->bind(&check_exit_codesize); | 428 masm_->bind(&check_exit_codesize); |
(...skipping 4455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4886 *context_length = 0; | 4884 *context_length = 0; |
4887 return previous_; | 4885 return previous_; |
4888 } | 4886 } |
4889 | 4887 |
4890 | 4888 |
4891 #undef __ | 4889 #undef __ |
4892 | 4890 |
4893 } } // namespace v8::internal | 4891 } } // namespace v8::internal |
4894 | 4892 |
4895 #endif // V8_TARGET_ARCH_ARM | 4893 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |