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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 EmitProfilingCounterDecrement(weight); | 346 EmitProfilingCounterDecrement(weight); |
347 __ j(positive, &ok, Label::kNear); | 347 __ j(positive, &ok, Label::kNear); |
348 InterruptStub stub; | 348 InterruptStub stub; |
349 __ CallStub(&stub); | 349 __ CallStub(&stub); |
350 | 350 |
351 // Record a mapping of this PC offset to the OSR id. This is used to find | 351 // Record a mapping of this PC offset to the OSR id. This is used to find |
352 // the AST id from the unoptimized code in order to use it as a key into | 352 // the AST id from the unoptimized code in order to use it as a key into |
353 // the deoptimization input data found in the optimized code. | 353 // the deoptimization input data found in the optimized code. |
354 RecordBackEdge(stmt->OsrEntryId()); | 354 RecordBackEdge(stmt->OsrEntryId()); |
355 | 355 |
356 // Loop stack checks can be patched to perform on-stack replacement. In | |
357 // order to decide whether or not to perform OSR we embed the loop depth | |
358 // in a test instruction after the call so we can extract it from the OSR | |
359 // builtin. | |
360 ASSERT(loop_depth() > 0); | |
361 __ test(eax, Immediate(Min(loop_depth(), Code::kMaxLoopNestingMarker))); | |
362 | |
363 EmitProfilingCounterReset(); | 356 EmitProfilingCounterReset(); |
364 | 357 |
365 __ bind(&ok); | 358 __ bind(&ok); |
366 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); | 359 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); |
367 // Record a mapping of the OSR id to this PC. This is used if the OSR | 360 // Record a mapping of the OSR id to this PC. This is used if the OSR |
368 // entry becomes the target of a bailout. We don't expect it to be, but | 361 // entry becomes the target of a bailout. We don't expect it to be, but |
369 // we want it to work if it is. | 362 // we want it to work if it is. |
370 PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS); | 363 PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS); |
371 } | 364 } |
372 | 365 |
(...skipping 4192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4565 *stack_depth = 0; | 4558 *stack_depth = 0; |
4566 *context_length = 0; | 4559 *context_length = 0; |
4567 return previous_; | 4560 return previous_; |
4568 } | 4561 } |
4569 | 4562 |
4570 #undef __ | 4563 #undef __ |
4571 | 4564 |
4572 } } // namespace v8::internal | 4565 } } // namespace v8::internal |
4573 | 4566 |
4574 #endif // V8_TARGET_ARCH_IA32 | 4567 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |