| 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 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2653 | 2653 |
| 2654 | 2654 |
| 2655 void Ia32CodeGenerator::Branch(bool if_true, Label* L) { | 2655 void Ia32CodeGenerator::Branch(bool if_true, Label* L) { |
| 2656 ASSERT(has_cc()); | 2656 ASSERT(has_cc()); |
| 2657 Condition cc = if_true ? cc_reg_ : NegateCondition(cc_reg_); | 2657 Condition cc = if_true ? cc_reg_ : NegateCondition(cc_reg_); |
| 2658 __ j(cc, L); | 2658 __ j(cc, L); |
| 2659 cc_reg_ = no_condition; | 2659 cc_reg_ = no_condition; |
| 2660 } | 2660 } |
| 2661 | 2661 |
| 2662 | 2662 |
| 2663 class StackCheckDeferred: public DeferredCode { | |
| 2664 public: | |
| 2665 explicit StackCheckDeferred(CodeGenerator* generator) | |
| 2666 : DeferredCode(generator) { | |
| 2667 set_comment("[ StackCheckDeferred"); | |
| 2668 } | |
| 2669 virtual void Generate(); | |
| 2670 }; | |
| 2671 | |
| 2672 | |
| 2673 void StackCheckDeferred::Generate() { | |
| 2674 StackCheckStub stub; | |
| 2675 __ CallStub(&stub); | |
| 2676 } | |
| 2677 | |
| 2678 | |
| 2679 void Ia32CodeGenerator::CheckStack() { | 2663 void Ia32CodeGenerator::CheckStack() { |
| 2680 if (FLAG_check_stack) { | 2664 if (FLAG_check_stack) { |
| 2681 StackCheckDeferred* deferred = new StackCheckDeferred(this); | 2665 Label stack_is_ok; |
| 2666 StackCheckStub stub; |
| 2682 ExternalReference stack_guard_limit = | 2667 ExternalReference stack_guard_limit = |
| 2683 ExternalReference::address_of_stack_guard_limit(); | 2668 ExternalReference::address_of_stack_guard_limit(); |
| 2684 __ cmp(esp, Operand::StaticVariable(stack_guard_limit)); | 2669 __ cmp(esp, Operand::StaticVariable(stack_guard_limit)); |
| 2685 __ j(below, deferred->enter(), not_taken); | 2670 __ j(above_equal, &stack_is_ok, taken); |
| 2686 __ bind(deferred->exit()); | 2671 __ CallStub(&stub); |
| 2672 __ bind(&stack_is_ok); |
| 2687 } | 2673 } |
| 2688 } | 2674 } |
| 2689 | 2675 |
| 2690 | 2676 |
| 2691 void Ia32CodeGenerator::VisitBlock(Block* node) { | 2677 void Ia32CodeGenerator::VisitBlock(Block* node) { |
| 2692 Comment cmnt(masm_, "[ Block"); | 2678 Comment cmnt(masm_, "[ Block"); |
| 2693 RecordStatementPosition(node); | 2679 RecordStatementPosition(node); |
| 2694 node->set_break_stack_height(break_stack_height_); | 2680 node->set_break_stack_height(break_stack_height_); |
| 2695 VisitStatements(node->statements()); | 2681 VisitStatements(node->statements()); |
| 2696 __ bind(node->break_target()); | 2682 __ bind(node->break_target()); |
| (...skipping 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5503 bool is_eval) { | 5489 bool is_eval) { |
| 5504 Handle<Code> code = Ia32CodeGenerator::MakeCode(fun, script, is_eval); | 5490 Handle<Code> code = Ia32CodeGenerator::MakeCode(fun, script, is_eval); |
| 5505 if (!code.is_null()) { | 5491 if (!code.is_null()) { |
| 5506 Counters::total_compiled_code_size.Increment(code->instruction_size()); | 5492 Counters::total_compiled_code_size.Increment(code->instruction_size()); |
| 5507 } | 5493 } |
| 5508 return code; | 5494 return code; |
| 5509 } | 5495 } |
| 5510 | 5496 |
| 5511 | 5497 |
| 5512 } } // namespace v8::internal | 5498 } } // namespace v8::internal |
| OLD | NEW |