OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 Translation translation(&translations_, frame_count); | 560 Translation translation(&translations_, frame_count); |
561 WriteTranslation(environment, &translation); | 561 WriteTranslation(environment, &translation); |
562 int deoptimization_index = deoptimizations_.length(); | 562 int deoptimization_index = deoptimizations_.length(); |
563 environment->Register(deoptimization_index, translation.index()); | 563 environment->Register(deoptimization_index, translation.index()); |
564 deoptimizations_.Add(environment); | 564 deoptimizations_.Add(environment); |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
568 | 568 |
569 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { | 569 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { |
570 Abort("Unimplemented: %s", "Deoptimiz"); | 570 RegisterEnvironmentForDeoptimization(environment); |
| 571 ASSERT(environment->HasBeenRegistered()); |
| 572 int id = environment->deoptimization_index(); |
| 573 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); |
| 574 ASSERT(entry != NULL); |
| 575 if (entry == NULL) { |
| 576 Abort("bailout was not prepared"); |
| 577 return; |
| 578 } |
| 579 |
| 580 if (cc == no_condition) { |
| 581 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
| 582 } else { |
| 583 __ j(cc, entry, RelocInfo::RUNTIME_ENTRY); |
| 584 } |
571 } | 585 } |
572 | 586 |
573 | 587 |
574 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 588 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
575 int length = deoptimizations_.length(); | 589 int length = deoptimizations_.length(); |
576 if (length == 0) return; | 590 if (length == 0) return; |
577 ASSERT(FLAG_deopt); | 591 ASSERT(FLAG_deopt); |
578 Handle<DeoptimizationInputData> data = | 592 Handle<DeoptimizationInputData> data = |
579 Factory::NewDeoptimizationInputData(length, TENURED); | 593 Factory::NewDeoptimizationInputData(length, TENURED); |
580 | 594 |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 | 1946 |
1933 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 1947 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
1934 Abort("Unimplemented: %s", "DoOsrEntry"); | 1948 Abort("Unimplemented: %s", "DoOsrEntry"); |
1935 } | 1949 } |
1936 | 1950 |
1937 #undef __ | 1951 #undef __ |
1938 | 1952 |
1939 } } // namespace v8::internal | 1953 } } // namespace v8::internal |
1940 | 1954 |
1941 #endif // V8_TARGET_ARCH_X64 | 1955 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |