| 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 5640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5651 | 5651 |
| 5652 ASSERT(instr->HasEnvironment()); | 5652 ASSERT(instr->HasEnvironment()); |
| 5653 LEnvironment* env = instr->environment(); | 5653 LEnvironment* env = instr->environment(); |
| 5654 // There is no LLazyBailout instruction for stack-checks. We have to | 5654 // There is no LLazyBailout instruction for stack-checks. We have to |
| 5655 // prepare for lazy deoptimization explicitly here. | 5655 // prepare for lazy deoptimization explicitly here. |
| 5656 if (instr->hydrogen()->is_function_entry()) { | 5656 if (instr->hydrogen()->is_function_entry()) { |
| 5657 // Perform stack overflow check. | 5657 // Perform stack overflow check. |
| 5658 Label done; | 5658 Label done; |
| 5659 __ LoadRoot(at, Heap::kStackLimitRootIndex); | 5659 __ LoadRoot(at, Heap::kStackLimitRootIndex); |
| 5660 __ Branch(&done, hs, sp, Operand(at)); | 5660 __ Branch(&done, hs, sp, Operand(at)); |
| 5661 CallCode(isolate()->builtins()->StackCheck(), | 5661 CallRuntime(Runtime::kStackGuard, 0, instr); |
| 5662 RelocInfo::CODE_TARGET, | |
| 5663 instr); | |
| 5664 EnsureSpaceForLazyDeopt(); | 5662 EnsureSpaceForLazyDeopt(); |
| 5665 last_lazy_deopt_pc_ = masm()->pc_offset(); | 5663 last_lazy_deopt_pc_ = masm()->pc_offset(); |
| 5666 __ bind(&done); | 5664 __ bind(&done); |
| 5667 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 5665 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
| 5668 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5666 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
| 5669 } else { | 5667 } else { |
| 5670 ASSERT(instr->hydrogen()->is_backwards_branch()); | 5668 ASSERT(instr->hydrogen()->is_backwards_branch()); |
| 5671 // Perform stack overflow check if this goto needs it before jumping. | 5669 // Perform stack overflow check if this goto needs it before jumping. |
| 5672 DeferredStackCheck* deferred_stack_check = | 5670 DeferredStackCheck* deferred_stack_check = |
| 5673 new(zone()) DeferredStackCheck(this, instr); | 5671 new(zone()) DeferredStackCheck(this, instr); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5788 __ Subu(scratch, result, scratch); | 5786 __ Subu(scratch, result, scratch); |
| 5789 __ lw(result, FieldMemOperand(scratch, | 5787 __ lw(result, FieldMemOperand(scratch, |
| 5790 FixedArray::kHeaderSize - kPointerSize)); | 5788 FixedArray::kHeaderSize - kPointerSize)); |
| 5791 __ bind(&done); | 5789 __ bind(&done); |
| 5792 } | 5790 } |
| 5793 | 5791 |
| 5794 | 5792 |
| 5795 #undef __ | 5793 #undef __ |
| 5796 | 5794 |
| 5797 } } // namespace v8::internal | 5795 } } // namespace v8::internal |
| OLD | NEW |