| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 Condition cc = if_true ? cc_reg_ : NegateCondition(cc_reg_); | 1103 Condition cc = if_true ? cc_reg_ : NegateCondition(cc_reg_); |
| 1104 target->Branch(cc); | 1104 target->Branch(cc); |
| 1105 cc_reg_ = al; | 1105 cc_reg_ = al; |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 | 1108 |
| 1109 void CodeGenerator::CheckStack() { | 1109 void CodeGenerator::CheckStack() { |
| 1110 VirtualFrame::SpilledScope spilled_scope; | 1110 VirtualFrame::SpilledScope spilled_scope; |
| 1111 if (FLAG_check_stack) { | 1111 if (FLAG_check_stack) { |
| 1112 Comment cmnt(masm_, "[ check stack"); | 1112 Comment cmnt(masm_, "[ check stack"); |
| 1113 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 1114 __ cmp(sp, Operand(ip)); |
| 1113 StackCheckStub stub; | 1115 StackCheckStub stub; |
| 1114 frame_->CallStub(&stub, 0); | 1116 __ CallStub(&stub, lo); // Call the stub if lower. |
| 1115 } | 1117 } |
| 1116 } | 1118 } |
| 1117 | 1119 |
| 1118 | 1120 |
| 1119 void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) { | 1121 void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) { |
| 1120 #ifdef DEBUG | 1122 #ifdef DEBUG |
| 1121 int original_height = frame_->height(); | 1123 int original_height = frame_->height(); |
| 1122 #endif | 1124 #endif |
| 1123 VirtualFrame::SpilledScope spilled_scope; | 1125 VirtualFrame::SpilledScope spilled_scope; |
| 1124 for (int i = 0; frame_ != NULL && i < statements->length(); i++) { | 1126 for (int i = 0; frame_ != NULL && i < statements->length(); i++) { |
| (...skipping 4491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5616 } | 5618 } |
| 5617 | 5619 |
| 5618 default: UNREACHABLE(); | 5620 default: UNREACHABLE(); |
| 5619 } | 5621 } |
| 5620 // This code should be unreachable. | 5622 // This code should be unreachable. |
| 5621 __ stop("Unreachable"); | 5623 __ stop("Unreachable"); |
| 5622 } | 5624 } |
| 5623 | 5625 |
| 5624 | 5626 |
| 5625 void StackCheckStub::Generate(MacroAssembler* masm) { | 5627 void StackCheckStub::Generate(MacroAssembler* masm) { |
| 5626 Label within_limit; | |
| 5627 __ mov(ip, Operand(ExternalReference::address_of_stack_guard_limit())); | |
| 5628 __ ldr(ip, MemOperand(ip)); | |
| 5629 __ cmp(sp, Operand(ip)); | |
| 5630 __ b(hs, &within_limit); | |
| 5631 // Do tail-call to runtime routine. Runtime routines expect at least one | 5628 // Do tail-call to runtime routine. Runtime routines expect at least one |
| 5632 // argument, so give it a Smi. | 5629 // argument, so give it a Smi. |
| 5633 __ mov(r0, Operand(Smi::FromInt(0))); | 5630 __ mov(r0, Operand(Smi::FromInt(0))); |
| 5634 __ push(r0); | 5631 __ push(r0); |
| 5635 __ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1); | 5632 __ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1); |
| 5636 __ bind(&within_limit); | |
| 5637 | 5633 |
| 5638 __ StubReturn(1); | 5634 __ StubReturn(1); |
| 5639 } | 5635 } |
| 5640 | 5636 |
| 5641 | 5637 |
| 5642 void UnarySubStub::Generate(MacroAssembler* masm) { | 5638 void UnarySubStub::Generate(MacroAssembler* masm) { |
| 5643 Label undo; | 5639 Label undo; |
| 5644 Label slow; | 5640 Label slow; |
| 5645 Label not_smi; | 5641 Label not_smi; |
| 5646 | 5642 |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6261 int CompareStub::MinorKey() { | 6257 int CompareStub::MinorKey() { |
| 6262 // Encode the two parameters in a unique 16 bit value. | 6258 // Encode the two parameters in a unique 16 bit value. |
| 6263 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6259 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
| 6264 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6260 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
| 6265 } | 6261 } |
| 6266 | 6262 |
| 6267 | 6263 |
| 6268 #undef __ | 6264 #undef __ |
| 6269 | 6265 |
| 6270 } } // namespace v8::internal | 6266 } } // namespace v8::internal |
| OLD | NEW |