| 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 // |>------------ translation_size ------------<| | 516 // |>------------ translation_size ------------<| |
| 517 | 517 |
| 518 int frame_count = 0; | 518 int frame_count = 0; |
| 519 int jsframe_count = 0; | 519 int jsframe_count = 0; |
| 520 for (LEnvironment* e = environment; e != NULL; e = e->outer()) { | 520 for (LEnvironment* e = environment; e != NULL; e = e->outer()) { |
| 521 ++frame_count; | 521 ++frame_count; |
| 522 if (e->frame_type() == JS_FUNCTION) { | 522 if (e->frame_type() == JS_FUNCTION) { |
| 523 ++jsframe_count; | 523 ++jsframe_count; |
| 524 } | 524 } |
| 525 } | 525 } |
| 526 Translation translation(&translations_, frame_count, jsframe_count); | 526 Translation translation(&translations_, frame_count, jsframe_count, |
| 527 environment->zone()); |
| 527 WriteTranslation(environment, &translation); | 528 WriteTranslation(environment, &translation); |
| 528 int deoptimization_index = deoptimizations_.length(); | 529 int deoptimization_index = deoptimizations_.length(); |
| 529 int pc_offset = masm()->pc_offset(); | 530 int pc_offset = masm()->pc_offset(); |
| 530 environment->Register(deoptimization_index, | 531 environment->Register(deoptimization_index, |
| 531 translation.index(), | 532 translation.index(), |
| 532 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); | 533 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); |
| 533 deoptimizations_.Add(environment); | 534 deoptimizations_.Add(environment, environment->zone()); |
| 534 } | 535 } |
| 535 } | 536 } |
| 536 | 537 |
| 537 | 538 |
| 538 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { | 539 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { |
| 539 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 540 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 540 ASSERT(environment->HasBeenRegistered()); | 541 ASSERT(environment->HasBeenRegistered()); |
| 541 int id = environment->deoptimization_index(); | 542 int id = environment->deoptimization_index(); |
| 542 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); | 543 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); |
| 543 if (entry == NULL) { | 544 if (entry == NULL) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 Safepoint::DeoptMode deopt_mode) { | 638 Safepoint::DeoptMode deopt_mode) { |
| 638 ASSERT(kind == expected_safepoint_kind_); | 639 ASSERT(kind == expected_safepoint_kind_); |
| 639 | 640 |
| 640 const ZoneList<LOperand*>* operands = pointers->GetNormalizedOperands(); | 641 const ZoneList<LOperand*>* operands = pointers->GetNormalizedOperands(); |
| 641 | 642 |
| 642 Safepoint safepoint = safepoints_.DefineSafepoint(masm(), | 643 Safepoint safepoint = safepoints_.DefineSafepoint(masm(), |
| 643 kind, arguments, deopt_mode); | 644 kind, arguments, deopt_mode); |
| 644 for (int i = 0; i < operands->length(); i++) { | 645 for (int i = 0; i < operands->length(); i++) { |
| 645 LOperand* pointer = operands->at(i); | 646 LOperand* pointer = operands->at(i); |
| 646 if (pointer->IsStackSlot()) { | 647 if (pointer->IsStackSlot()) { |
| 647 safepoint.DefinePointerSlot(pointer->index()); | 648 safepoint.DefinePointerSlot(pointer->index(), zone()); |
| 648 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) { | 649 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) { |
| 649 safepoint.DefinePointerRegister(ToRegister(pointer)); | 650 safepoint.DefinePointerRegister(ToRegister(pointer)); |
| 650 } | 651 } |
| 651 } | 652 } |
| 652 if (kind & Safepoint::kWithRegisters) { | 653 if (kind & Safepoint::kWithRegisters) { |
| 653 // Register rsi always contains a pointer to the context. | 654 // Register rsi always contains a pointer to the context. |
| 654 safepoint.DefinePointerRegister(rsi); | 655 safepoint.DefinePointerRegister(rsi); |
| 655 } | 656 } |
| 656 } | 657 } |
| 657 | 658 |
| (...skipping 4236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4894 FixedArray::kHeaderSize - kPointerSize)); | 4895 FixedArray::kHeaderSize - kPointerSize)); |
| 4895 __ bind(&done); | 4896 __ bind(&done); |
| 4896 } | 4897 } |
| 4897 | 4898 |
| 4898 | 4899 |
| 4899 #undef __ | 4900 #undef __ |
| 4900 | 4901 |
| 4901 } } // namespace v8::internal | 4902 } } // namespace v8::internal |
| 4902 | 4903 |
| 4903 #endif // V8_TARGET_ARCH_X64 | 4904 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |