| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 __ LoadObject(temp, function); | 88 __ LoadObject(temp, function); |
| 89 __ pushl(result); // Preserve result. | 89 __ pushl(result); // Preserve result. |
| 90 __ pushl(temp); | 90 __ pushl(temp); |
| 91 compiler->GenerateCallRuntime(Isolate::kNoDeoptId, | 91 compiler->GenerateCallRuntime(Isolate::kNoDeoptId, |
| 92 0, | 92 0, |
| 93 CatchClauseNode::kInvalidTryIndex, | 93 CatchClauseNode::kInvalidTryIndex, |
| 94 kTraceFunctionExitRuntimeEntry); | 94 kTraceFunctionExitRuntimeEntry); |
| 95 __ popl(temp); // Remove argument. | 95 __ popl(temp); // Remove argument. |
| 96 __ popl(result); // Restore result. | 96 __ popl(result); // Restore result. |
| 97 } | 97 } |
| 98 #if defined(DEBUG) |
| 99 // TODO(srdjan): Fix for functions with finally clause. |
| 100 // A finally clause may leave a previously pushed return value if it |
| 101 // has its own return instruction. Method that have finally are currently |
| 102 // not optimized. |
| 103 if (!compiler->HasFinally()) { |
| 104 Label done; |
| 105 __ movl(EDI, EBP); |
| 106 __ subl(EDI, ESP); |
| 107 // + 1 for Pc marker. |
| 108 __ cmpl(EDI, Immediate((compiler->StackSize() + 1) * kWordSize)); |
| 109 __ j(EQUAL, &done, Assembler::kNearJump); |
| 110 __ int3(); |
| 111 __ Bind(&done); |
| 112 } |
| 113 #endif |
| 98 __ LeaveFrame(); | 114 __ LeaveFrame(); |
| 99 __ ret(); | 115 __ ret(); |
| 100 | 116 |
| 101 // Generate 1 byte NOP so that the debugger can patch the | 117 // Generate 1 byte NOP so that the debugger can patch the |
| 102 // return pattern with a call to the debug stub. | 118 // return pattern with a call to the debug stub. |
| 103 __ nop(1); | 119 __ nop(1); |
| 104 compiler->AddCurrentDescriptor(PcDescriptors::kReturn, | 120 compiler->AddCurrentDescriptor(PcDescriptors::kReturn, |
| 105 deopt_id(), | 121 deopt_id(), |
| 106 token_pos(), | 122 token_pos(), |
| 107 CatchClauseNode::kInvalidTryIndex); | 123 CatchClauseNode::kInvalidTryIndex); |
| (...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2107 ASSERT(locs()->out().reg() == EAX); | 2123 ASSERT(locs()->out().reg() == EAX); |
| 2108 __ CompareObject(locs()->out().reg(), compiler->bool_true()); | 2124 __ CompareObject(locs()->out().reg(), compiler->bool_true()); |
| 2109 EmitBranchOnCondition(compiler, branch_condition); | 2125 EmitBranchOnCondition(compiler, branch_condition); |
| 2110 } | 2126 } |
| 2111 | 2127 |
| 2112 } // namespace dart | 2128 } // namespace dart |
| 2113 | 2129 |
| 2114 #undef __ | 2130 #undef __ |
| 2115 | 2131 |
| 2116 #endif // defined TARGET_ARCH_X64 | 2132 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |