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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 int id = environment->deoptimization_index(); | 925 int id = environment->deoptimization_index(); |
926 ASSERT(info()->IsOptimizing() || info()->IsStub()); | 926 ASSERT(info()->IsOptimizing() || info()->IsStub()); |
927 Address entry = | 927 Address entry = |
928 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 928 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
929 if (entry == NULL) { | 929 if (entry == NULL) { |
930 Abort("bailout was not prepared"); | 930 Abort("bailout was not prepared"); |
931 return; | 931 return; |
932 } | 932 } |
933 | 933 |
934 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { | 934 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
935 Handle<SharedFunctionInfo> shared(info()->shared_info()); | 935 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); |
936 Label no_deopt; | 936 Label no_deopt; |
937 __ pushfd(); | 937 __ pushfd(); |
938 __ push(eax); | 938 __ push(eax); |
939 __ push(ebx); | 939 __ mov(eax, Operand::StaticVariable(count)); |
940 __ mov(ebx, shared); | 940 __ sub(eax, Immediate(1)); |
941 __ mov(eax, | |
942 FieldOperand(ebx, SharedFunctionInfo::kStressDeoptCounterOffset)); | |
943 __ sub(Operand(eax), Immediate(Smi::FromInt(1))); | |
944 __ j(not_zero, &no_deopt, Label::kNear); | 941 __ j(not_zero, &no_deopt, Label::kNear); |
945 if (FLAG_trap_on_deopt) __ int3(); | 942 if (FLAG_trap_on_deopt) __ int3(); |
946 __ mov(eax, Immediate(Smi::FromInt(FLAG_deopt_every_n_times))); | 943 __ mov(eax, Immediate(FLAG_deopt_every_n_times)); |
947 __ mov(FieldOperand(ebx, SharedFunctionInfo::kStressDeoptCounterOffset), | 944 __ mov(Operand::StaticVariable(count), eax); |
948 eax); | |
949 __ pop(ebx); | |
950 __ pop(eax); | 945 __ pop(eax); |
951 __ popfd(); | 946 __ popfd(); |
952 ASSERT(frame_is_built_); | 947 ASSERT(frame_is_built_); |
953 __ call(entry, RelocInfo::RUNTIME_ENTRY); | 948 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
954 | |
955 __ bind(&no_deopt); | 949 __ bind(&no_deopt); |
956 __ mov(FieldOperand(ebx, SharedFunctionInfo::kStressDeoptCounterOffset), | 950 __ mov(Operand::StaticVariable(count), eax); |
957 eax); | |
958 __ pop(ebx); | |
959 __ pop(eax); | 951 __ pop(eax); |
960 __ popfd(); | 952 __ popfd(); |
961 } | 953 } |
962 | 954 |
963 // Before Instructions which can deopt, we normally flush the x87 stack. But | 955 // Before Instructions which can deopt, we normally flush the x87 stack. But |
964 // we can have inputs or outputs of the current instruction on the stack, | 956 // we can have inputs or outputs of the current instruction on the stack, |
965 // thus we need to flush them here from the physical stack to leave it in a | 957 // thus we need to flush them here from the physical stack to leave it in a |
966 // consistent state. | 958 // consistent state. |
967 if (x87_stack_depth_ > 0) { | 959 if (x87_stack_depth_ > 0) { |
968 Label done; | 960 Label done; |
(...skipping 5528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6497 FixedArray::kHeaderSize - kPointerSize)); | 6489 FixedArray::kHeaderSize - kPointerSize)); |
6498 __ bind(&done); | 6490 __ bind(&done); |
6499 } | 6491 } |
6500 | 6492 |
6501 | 6493 |
6502 #undef __ | 6494 #undef __ |
6503 | 6495 |
6504 } } // namespace v8::internal | 6496 } } // namespace v8::internal |
6505 | 6497 |
6506 #endif // V8_TARGET_ARCH_IA32 | 6498 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |