| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 // Convert the TOS value to a boolean in the condition code register. | 434 // Convert the TOS value to a boolean in the condition code register. |
| 435 ToBoolean(true_target, false_target); | 435 ToBoolean(true_target, false_target); |
| 436 } | 436 } |
| 437 ASSERT(!force_cc || !has_valid_frame() || has_cc()); | 437 ASSERT(!force_cc || !has_valid_frame() || has_cc()); |
| 438 ASSERT(!has_valid_frame() || | 438 ASSERT(!has_valid_frame() || |
| 439 (has_cc() && frame_->height() == original_height) || | 439 (has_cc() && frame_->height() == original_height) || |
| 440 (!has_cc() && frame_->height() == original_height + 1)); | 440 (!has_cc() && frame_->height() == original_height + 1)); |
| 441 } | 441 } |
| 442 | 442 |
| 443 | 443 |
| 444 void CodeGenerator::LoadAndSpill(Expression* expression, | |
| 445 TypeofState typeof_state) { | |
| 446 ASSERT(in_spilled_code()); | |
| 447 set_in_spilled_code(false); | |
| 448 Load(expression, typeof_state); | |
| 449 frame_->SpillAll(); | |
| 450 set_in_spilled_code(true); | |
| 451 } | |
| 452 | |
| 453 | |
| 454 void CodeGenerator::Load(Expression* x, TypeofState typeof_state) { | 444 void CodeGenerator::Load(Expression* x, TypeofState typeof_state) { |
| 455 #ifdef DEBUG | 445 #ifdef DEBUG |
| 456 int original_height = frame_->height(); | 446 int original_height = frame_->height(); |
| 457 #endif | 447 #endif |
| 458 ASSERT(!in_spilled_code()); | 448 ASSERT(!in_spilled_code()); |
| 459 JumpTarget true_target(this); | 449 JumpTarget true_target(this); |
| 460 JumpTarget false_target(this); | 450 JumpTarget false_target(this); |
| 461 LoadCondition(x, typeof_state, &true_target, &false_target, false); | 451 LoadCondition(x, typeof_state, &true_target, &false_target, false); |
| 462 | 452 |
| 463 if (has_cc()) { | 453 if (has_cc()) { |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 void CodeGenerator::CheckStack() { | 1098 void CodeGenerator::CheckStack() { |
| 1109 VirtualFrame::SpilledScope spilled_scope(this); | 1099 VirtualFrame::SpilledScope spilled_scope(this); |
| 1110 if (FLAG_check_stack) { | 1100 if (FLAG_check_stack) { |
| 1111 Comment cmnt(masm_, "[ check stack"); | 1101 Comment cmnt(masm_, "[ check stack"); |
| 1112 StackCheckStub stub; | 1102 StackCheckStub stub; |
| 1113 frame_->CallStub(&stub, 0); | 1103 frame_->CallStub(&stub, 0); |
| 1114 } | 1104 } |
| 1115 } | 1105 } |
| 1116 | 1106 |
| 1117 | 1107 |
| 1118 void CodeGenerator::VisitAndSpill(Statement* statement) { | |
| 1119 ASSERT(in_spilled_code()); | |
| 1120 set_in_spilled_code(false); | |
| 1121 Visit(statement); | |
| 1122 if (frame_ != NULL) { | |
| 1123 frame_->SpillAll(); | |
| 1124 } | |
| 1125 set_in_spilled_code(true); | |
| 1126 } | |
| 1127 | |
| 1128 | |
| 1129 void CodeGenerator::VisitStatementsAndSpill(ZoneList<Statement*>* statements) { | |
| 1130 ASSERT(in_spilled_code()); | |
| 1131 set_in_spilled_code(false); | |
| 1132 VisitStatements(statements); | |
| 1133 if (frame_ != NULL) { | |
| 1134 frame_->SpillAll(); | |
| 1135 } | |
| 1136 set_in_spilled_code(true); | |
| 1137 } | |
| 1138 | |
| 1139 | |
| 1140 void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) { | 1108 void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) { |
| 1141 #ifdef DEBUG | 1109 #ifdef DEBUG |
| 1142 int original_height = frame_->height(); | 1110 int original_height = frame_->height(); |
| 1143 #endif | 1111 #endif |
| 1144 VirtualFrame::SpilledScope spilled_scope(this); | 1112 VirtualFrame::SpilledScope spilled_scope(this); |
| 1145 for (int i = 0; frame_ != NULL && i < statements->length(); i++) { | 1113 for (int i = 0; frame_ != NULL && i < statements->length(); i++) { |
| 1146 VisitAndSpill(statements->at(i)); | 1114 VisitAndSpill(statements->at(i)); |
| 1147 } | 1115 } |
| 1148 ASSERT(!has_valid_frame() || frame_->height() == original_height); | 1116 ASSERT(!has_valid_frame() || frame_->height() == original_height); |
| 1149 } | 1117 } |
| (...skipping 4034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5184 __ mov(r2, Operand(0)); | 5152 __ mov(r2, Operand(0)); |
| 5185 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 5153 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
| 5186 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 5154 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
| 5187 RelocInfo::CODE_TARGET); | 5155 RelocInfo::CODE_TARGET); |
| 5188 } | 5156 } |
| 5189 | 5157 |
| 5190 | 5158 |
| 5191 #undef __ | 5159 #undef __ |
| 5192 | 5160 |
| 5193 } } // namespace v8::internal | 5161 } } // namespace v8::internal |
| OLD | NEW |