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 4469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4480 } | 4480 } |
4481 | 4481 |
4482 | 4482 |
4483 void LCodeGen::EnsureSpaceForLazyDeopt() { | 4483 void LCodeGen::EnsureSpaceForLazyDeopt() { |
4484 // Ensure that we have enough space after the previous lazy-bailout | 4484 // Ensure that we have enough space after the previous lazy-bailout |
4485 // instruction for patching the code here. | 4485 // instruction for patching the code here. |
4486 int current_pc = masm()->pc_offset(); | 4486 int current_pc = masm()->pc_offset(); |
4487 int patch_size = Deoptimizer::patch_size(); | 4487 int patch_size = Deoptimizer::patch_size(); |
4488 if (current_pc < last_lazy_deopt_pc_ + patch_size) { | 4488 if (current_pc < last_lazy_deopt_pc_ + patch_size) { |
4489 int padding_size = last_lazy_deopt_pc_ + patch_size - current_pc; | 4489 int padding_size = last_lazy_deopt_pc_ + patch_size - current_pc; |
4490 while (padding_size-- > 0) { | 4490 __ Nop(padding_size); |
4491 __ nop(); | |
4492 } | |
4493 } | 4491 } |
4494 last_lazy_deopt_pc_ = masm()->pc_offset(); | 4492 last_lazy_deopt_pc_ = masm()->pc_offset(); |
4495 } | 4493 } |
4496 | 4494 |
4497 | 4495 |
4498 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { | 4496 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { |
4499 EnsureSpaceForLazyDeopt(); | 4497 EnsureSpaceForLazyDeopt(); |
4500 ASSERT(instr->HasEnvironment()); | 4498 ASSERT(instr->HasEnvironment()); |
4501 LEnvironment* env = instr->environment(); | 4499 LEnvironment* env = instr->environment(); |
4502 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 4500 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4611 this, pointers, Safepoint::kLazyDeopt); | 4609 this, pointers, Safepoint::kLazyDeopt); |
4612 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4610 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4613 } | 4611 } |
4614 | 4612 |
4615 | 4613 |
4616 #undef __ | 4614 #undef __ |
4617 | 4615 |
4618 } } // namespace v8::internal | 4616 } } // namespace v8::internal |
4619 | 4617 |
4620 #endif // V8_TARGET_ARCH_IA32 | 4618 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |