OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 } | 454 } |
455 __ LeaveFrame(); | 455 __ LeaveFrame(); |
456 | 456 |
457 __ popl(ECX); // Pop return address. | 457 __ popl(ECX); // Pop return address. |
458 __ addl(ESP, EBX); // Remove materialization arguments. | 458 __ addl(ESP, EBX); // Remove materialization arguments. |
459 __ pushl(ECX); // Push return address. | 459 __ pushl(ECX); // Push return address. |
460 __ ret(); | 460 __ ret(); |
461 } | 461 } |
462 | 462 |
463 | 463 |
| 464 // TOS: return address + call-instruction-size (5 bytes). |
464 // EAX: result, must be preserved | 465 // EAX: result, must be preserved |
465 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { | 466 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { |
466 // Return address for "call" to deopt stub. | 467 // Correct return address to point just after the call that is being |
467 __ pushl(Immediate(0xe1e1e1e1)); | 468 // deoptimized. |
| 469 __ popl(EBX); |
| 470 __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes())); |
| 471 __ pushl(EBX); |
468 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); | 472 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); |
469 } | 473 } |
470 | 474 |
471 | 475 |
| 476 // TOS: return address + call-instruction-size (5 bytes). |
472 // EAX: exception, must be preserved | 477 // EAX: exception, must be preserved |
473 // EDX: stacktrace, must be preserved | 478 // EDX: stacktrace, must be preserved |
474 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { | 479 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { |
475 // Return address for "call" to deopt stub. | 480 // Correct return address to point just after the call that is being |
476 __ pushl(Immediate(0xe1e1e1e1)); | 481 // deoptimized. |
| 482 __ popl(EBX); |
| 483 __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes())); |
| 484 __ pushl(EBX); |
477 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); | 485 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); |
478 } | 486 } |
479 | 487 |
480 | 488 |
481 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { | 489 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { |
482 GenerateDeoptimizationSequence(assembler, kEagerDeopt); | 490 GenerateDeoptimizationSequence(assembler, kEagerDeopt); |
483 } | 491 } |
484 | 492 |
485 | 493 |
486 static void GenerateDispatcherCode(Assembler* assembler, | 494 static void GenerateDispatcherCode(Assembler* assembler, |
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2064 } | 2072 } |
2065 | 2073 |
2066 | 2074 |
2067 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2075 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2068 __ int3(); | 2076 __ int3(); |
2069 } | 2077 } |
2070 | 2078 |
2071 } // namespace dart | 2079 } // namespace dart |
2072 | 2080 |
2073 #endif // defined TARGET_ARCH_IA32 | 2081 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |