| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 __ push(ebp); | 58 __ push(ebp); |
| 59 __ mov(ebp, esp); | 59 __ mov(ebp, esp); |
| 60 __ push(esi); | 60 __ push(esi); |
| 61 __ push(edi); | 61 __ push(edi); |
| 62 if (local_count_ > 0) { | 62 if (local_count_ > 0) { |
| 63 __ Set(eax, Immediate(Factory::undefined_value())); | 63 __ Set(eax, Immediate(Factory::undefined_value())); |
| 64 for (int i = 0; i < local_count_; i++) { | 64 for (int i = 0; i < local_count_; i++) { |
| 65 __ push(eax); | 65 __ push(eax); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 if (FLAG_trace) { |
| 69 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 70 } |
| 68 if (FLAG_check_stack) { | 71 if (FLAG_check_stack) { |
| 69 ExternalReference stack_limit = | 72 ExternalReference stack_limit = |
| 70 ExternalReference::address_of_stack_guard_limit(); | 73 ExternalReference::address_of_stack_guard_limit(); |
| 71 __ cmp(esp, Operand::StaticVariable(stack_limit)); | 74 __ cmp(esp, Operand::StaticVariable(stack_limit)); |
| 72 __ j(below, &deferred_enter); | 75 __ j(below, &deferred_enter); |
| 73 __ bind(&deferred_exit); | 76 __ bind(&deferred_exit); |
| 74 } | 77 } |
| 75 } | 78 } |
| 76 successor_->Compile(masm); | 79 successor_->Compile(masm); |
| 77 if (FLAG_check_stack) { | 80 if (FLAG_check_stack) { |
| 78 __ bind(&deferred_enter); | 81 __ bind(&deferred_enter); |
| 79 StackCheckStub stub; | 82 StackCheckStub stub; |
| 80 __ CallStub(&stub); | 83 __ CallStub(&stub); |
| 81 __ jmp(&deferred_exit); | 84 __ jmp(&deferred_exit); |
| 82 } | 85 } |
| 83 } | 86 } |
| 84 | 87 |
| 85 | 88 |
| 86 void ExitNode::Compile(MacroAssembler* masm) { | 89 void ExitNode::Compile(MacroAssembler* masm) { |
| 87 ASSERT(!is_marked()); | 90 ASSERT(!is_marked()); |
| 88 is_marked_ = true; | 91 is_marked_ = true; |
| 89 Comment cmnt(masm, "[ ExitNode"); | 92 Comment cmnt(masm, "[ ExitNode"); |
| 93 if (FLAG_trace) { |
| 94 __ push(eax); |
| 95 __ CallRuntime(Runtime::kTraceExit, 1); |
| 96 } |
| 90 __ RecordJSReturn(); | 97 __ RecordJSReturn(); |
| 91 __ mov(esp, ebp); | 98 __ mov(esp, ebp); |
| 92 __ pop(ebp); | 99 __ pop(ebp); |
| 93 __ ret((parameter_count_ + 1) * kPointerSize); | 100 __ ret((parameter_count_ + 1) * kPointerSize); |
| 94 } | 101 } |
| 95 | 102 |
| 96 | 103 |
| 97 void ReturnInstr::Compile(MacroAssembler* masm) { | 104 void ReturnInstr::Compile(MacroAssembler* masm) { |
| 98 Comment cmnt(masm, "[ ReturnInstr"); | 105 Comment cmnt(masm, "[ ReturnInstr"); |
| 99 value_->ToRegister(masm, eax); | 106 value_->ToRegister(masm, eax); |
| 100 } | 107 } |
| 101 | 108 |
| 102 | 109 |
| 103 void Constant::ToRegister(MacroAssembler* masm, Register reg) { | 110 void Constant::ToRegister(MacroAssembler* masm, Register reg) { |
| 104 __ mov(reg, Immediate(handle_)); | 111 __ mov(reg, Immediate(handle_)); |
| 105 } | 112 } |
| 106 | 113 |
| 107 #undef __ | 114 #undef __ |
| 108 | 115 |
| 109 } } // namespace v8::internal | 116 } } // namespace v8::internal |
| OLD | NEW |