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). | |
465 // EAX: result, must be preserved | 464 // EAX: result, must be preserved |
466 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { | 465 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { |
467 // Correct return address to point just after the call that is being | 466 // Return address for "call" to deopt stub. |
468 // deoptimized. | 467 __ pushl(Immediate(0xe1e1e1e1)); |
469 __ popl(EBX); | |
470 __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes())); | |
471 __ pushl(EBX); | |
472 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); | 468 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); |
473 } | 469 } |
474 | 470 |
475 | 471 |
476 // TOS: return address + call-instruction-size (5 bytes). | |
477 // EAX: exception, must be preserved | 472 // EAX: exception, must be preserved |
478 // EDX: stacktrace, must be preserved | 473 // EDX: stacktrace, must be preserved |
479 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { | 474 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { |
480 // Correct return address to point just after the call that is being | 475 // Return address for "call" to deopt stub. |
481 // deoptimized. | 476 __ pushl(Immediate(0xe1e1e1e1)); |
482 __ popl(EBX); | |
483 __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes())); | |
484 __ pushl(EBX); | |
485 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); | 477 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); |
486 } | 478 } |
487 | 479 |
488 | 480 |
489 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { | 481 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { |
490 GenerateDeoptimizationSequence(assembler, kEagerDeopt); | 482 GenerateDeoptimizationSequence(assembler, kEagerDeopt); |
491 } | 483 } |
492 | 484 |
493 | 485 |
494 static void GenerateDispatcherCode(Assembler* assembler, | 486 static void GenerateDispatcherCode(Assembler* assembler, |
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 } | 2064 } |
2073 | 2065 |
2074 | 2066 |
2075 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2067 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2076 __ int3(); | 2068 __ int3(); |
2077 } | 2069 } |
2078 | 2070 |
2079 } // namespace dart | 2071 } // namespace dart |
2080 | 2072 |
2081 #endif // defined TARGET_ARCH_IA32 | 2073 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |