| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 Deoptimizer::BailoutType bailout_type = info()->IsStub() ? Deoptimizer::LAZY | 951 Deoptimizer::BailoutType bailout_type = info()->IsStub() ? Deoptimizer::LAZY |
| 952 : Deoptimizer::EAGER; | 952 : Deoptimizer::EAGER; |
| 953 Address entry = | 953 Address entry = |
| 954 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 954 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| 955 | 955 |
| 956 if (entry == NULL) { | 956 if (entry == NULL) { |
| 957 Abort(kBailoutWasNotPrepared); | 957 Abort(kBailoutWasNotPrepared); |
| 958 return false; | 958 return false; |
| 959 } | 959 } |
| 960 | 960 |
| 961 ASSERT(FLAG_deopt_every_n_times < 2); // Other values not supported on A64. | 961 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
| 962 TODO_UNIMPLEMENTED("Support for FLAG_deopt_every_n_times >= 2."); | 962 Label not_zero; |
| 963 if (FLAG_deopt_every_n_times == 1 && | 963 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); |
| 964 !info()->IsStub() && | 964 |
| 965 info()->opt_count() == id) { | 965 __ Push(x0, x1); |
| 966 __ Mov(x0, Operand(count)); |
| 967 __ Ldr(w1, MemOperand(x0)); |
| 968 __ Subs(x1, x1, 1); |
| 969 __ B(gt, ¬_zero); |
| 970 __ Mov(w1, FLAG_deopt_every_n_times); |
| 971 __ Str(w1, MemOperand(x0)); |
| 972 __ Pop(x0, x1); |
| 966 ASSERT(frame_is_built_); | 973 ASSERT(frame_is_built_); |
| 967 __ Call(entry, RelocInfo::RUNTIME_ENTRY); | 974 __ Call(entry, RelocInfo::RUNTIME_ENTRY); |
| 968 return false; | 975 __ Unreachable(); |
| 976 |
| 977 __ Bind(¬_zero); |
| 978 __ Str(w1, MemOperand(x0)); |
| 979 __ Pop(x0, x1); |
| 969 } | 980 } |
| 970 | 981 |
| 971 return true; | 982 return true; |
| 972 } | 983 } |
| 973 | 984 |
| 974 | 985 |
| 975 void LCodeGen::Deoptimize(LEnvironment* environment, | 986 void LCodeGen::Deoptimize(LEnvironment* environment, |
| 976 Deoptimizer::BailoutType bailout_type) { | 987 Deoptimizer::BailoutType bailout_type) { |
| 977 if (!DeoptimizeHeader(environment)) return; | |
| 978 | |
| 979 ASSERT(environment->HasBeenRegistered()); | 988 ASSERT(environment->HasBeenRegistered()); |
| 980 ASSERT(info()->IsOptimizing() || info()->IsStub()); | 989 ASSERT(info()->IsOptimizing() || info()->IsStub()); |
| 981 int id = environment->deoptimization_index(); | 990 int id = environment->deoptimization_index(); |
| 982 Address entry = | 991 Address entry = |
| 983 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 992 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| 984 | 993 |
| 985 if (info()->ShouldTrapOnDeopt()) { | 994 if (info()->ShouldTrapOnDeopt()) { |
| 986 __ Debug("trap_on_deopt", __LINE__, BREAK); | 995 __ Debug("trap_on_deopt", __LINE__, BREAK); |
| 987 } | 996 } |
| 988 | 997 |
| (...skipping 4663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5652 __ Bind(&out_of_object); | 5661 __ Bind(&out_of_object); |
| 5653 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5662 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5654 // Index is equal to negated out of object property index plus 1. | 5663 // Index is equal to negated out of object property index plus 1. |
| 5655 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5664 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5656 __ Ldr(result, FieldMemOperand(result, | 5665 __ Ldr(result, FieldMemOperand(result, |
| 5657 FixedArray::kHeaderSize - kPointerSize)); | 5666 FixedArray::kHeaderSize - kPointerSize)); |
| 5658 __ Bind(&done); | 5667 __ Bind(&done); |
| 5659 } | 5668 } |
| 5660 | 5669 |
| 5661 } } // namespace v8::internal | 5670 } } // namespace v8::internal |
| OLD | NEW |