| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // (partially) translated into branches, or it may have set the condition | 375 // (partially) translated into branches, or it may have set the condition |
| 376 // code register. If force_cc is set, the value is forced to set the | 376 // code register. If force_cc is set, the value is forced to set the |
| 377 // condition code register and no value is pushed. If the condition code | 377 // condition code register and no value is pushed. If the condition code |
| 378 // register was set, has_cc() is true and cc_reg_ contains the condition to | 378 // register was set, has_cc() is true and cc_reg_ contains the condition to |
| 379 // test for 'true'. | 379 // test for 'true'. |
| 380 void CodeGenerator::LoadCondition(Expression* x, | 380 void CodeGenerator::LoadCondition(Expression* x, |
| 381 TypeofState typeof_state, | 381 TypeofState typeof_state, |
| 382 JumpTarget* true_target, | 382 JumpTarget* true_target, |
| 383 JumpTarget* false_target, | 383 JumpTarget* false_target, |
| 384 bool force_cc) { | 384 bool force_cc) { |
| 385 #ifdef DEBUG | |
| 386 int original_height = frame_->height(); | |
| 387 #endif | |
| 388 ASSERT(!in_spilled_code()); | 385 ASSERT(!in_spilled_code()); |
| 389 ASSERT(!has_cc()); | 386 ASSERT(!has_cc()); |
| 387 int original_height = frame_->height(); |
| 390 | 388 |
| 391 { CodeGenState new_state(this, typeof_state, true_target, false_target); | 389 { CodeGenState new_state(this, typeof_state, true_target, false_target); |
| 392 Visit(x); | 390 Visit(x); |
| 391 |
| 392 // If we hit a stack overflow, we may not have actually visited |
| 393 // the expression. In that case, we ensure that we have a |
| 394 // valid-looking frame state because we will continue to generate |
| 395 // code as we unwind the C++ stack. |
| 396 // |
| 397 // It's possible to have both a stack overflow and a valid frame |
| 398 // state (eg, a subexpression overflowed, visiting it returned |
| 399 // with a dummied frame state, and visiting this expression |
| 400 // returned with a normal-looking state). |
| 401 if (HasStackOverflow() && |
| 402 has_valid_frame() && |
| 403 !has_cc() && |
| 404 frame_->height() == original_height) { |
| 405 true_target->Jump(); |
| 406 } |
| 393 } | 407 } |
| 394 if (force_cc && frame_ != NULL && !has_cc()) { | 408 if (force_cc && frame_ != NULL && !has_cc()) { |
| 395 // Convert the TOS value to a boolean in the condition code register. | 409 // Convert the TOS value to a boolean in the condition code register. |
| 396 ToBoolean(true_target, false_target); | 410 ToBoolean(true_target, false_target); |
| 397 } | 411 } |
| 398 ASSERT(!force_cc || !has_valid_frame() || has_cc()); | 412 ASSERT(!force_cc || !has_valid_frame() || has_cc()); |
| 399 ASSERT(!has_valid_frame() || | 413 ASSERT(!has_valid_frame() || |
| 400 (has_cc() && frame_->height() == original_height) || | 414 (has_cc() && frame_->height() == original_height) || |
| 401 (!has_cc() && frame_->height() == original_height + 1)); | 415 (!has_cc() && frame_->height() == original_height + 1)); |
| 402 } | 416 } |
| (...skipping 4598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5001 __ mov(r2, Operand(0)); | 5015 __ mov(r2, Operand(0)); |
| 5002 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 5016 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
| 5003 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 5017 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
| 5004 RelocInfo::CODE_TARGET); | 5018 RelocInfo::CODE_TARGET); |
| 5005 } | 5019 } |
| 5006 | 5020 |
| 5007 | 5021 |
| 5008 #undef __ | 5022 #undef __ |
| 5009 | 5023 |
| 5010 } } // namespace v8::internal | 5024 } } // namespace v8::internal |
| OLD | NEW |