Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 22590002: Fix bug with optimized try-catch on ARM/MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added cleanup of CatchEntry Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2119 2119
2120 compiler->GenerateCallRuntime(token_pos(), 2120 compiler->GenerateCallRuntime(token_pos(),
2121 deopt_id(), 2121 deopt_id(),
2122 kCloneContextRuntimeEntry, 2122 kCloneContextRuntimeEntry,
2123 locs()); 2123 locs());
2124 __ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context). 2124 __ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context).
2125 __ addiu(SP, SP, Immediate(2 * kWordSize)); 2125 __ addiu(SP, SP, Immediate(2 * kWordSize));
2126 } 2126 }
2127 2127
2128 2128
2129 LocationSummary* CatchEntryInstr::MakeLocationSummary() const { 2129 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary() const {
2130 return LocationSummary::Make(0, 2130 UNREACHABLE();
2131 Location::NoLocation(), 2131 return NULL;
2132 LocationSummary::kNoCall);
2133 } 2132 }
2134 2133
2135 2134
2136 // Restore stack and initialize the two exception variables: 2135 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2137 // exception and stack trace variables. 2136 __ Bind(compiler->GetJumpLabel(this));
2138 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2137 compiler->AddExceptionHandler(catch_try_index(),
2138 try_index(),
2139 compiler->assembler()->CodeSize(),
2140 catch_handler_types_);
2141 // Restore pool pointer.
2142 __ GetNextPC(CMPRES, TMP);
2143 const intptr_t object_pool_pc_dist =
2144 Instructions::HeaderSize() - Instructions::object_pool_offset() +
2145 compiler->assembler()->CodeSize() - 1 * Instr::kInstrSize;
2146 __ LoadFromOffset(PP, CMPRES, -object_pool_pc_dist);
2147
2148 if (HasParallelMove()) {
2149 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
2150 }
2151
2139 // Restore SP from FP as we are coming from a throw and the code for 2152 // Restore SP from FP as we are coming from a throw and the code for
2140 // popping arguments has not been run. 2153 // popping arguments has not been run.
2141 const intptr_t fp_sp_dist = 2154 const intptr_t fp_sp_dist =
2142 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; 2155 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize;
2143 ASSERT(fp_sp_dist <= 0); 2156 ASSERT(fp_sp_dist <= 0);
2144 __ AddImmediate(SP, FP, fp_sp_dist); 2157 __ AddImmediate(SP, FP, fp_sp_dist);
2145 2158
2146 ASSERT(!exception_var().is_captured()); 2159 // Restore stack and initialize the two exception variables:
2147 ASSERT(!stacktrace_var().is_captured()); 2160 // exception and stack trace variables.
2148
2149 __ sw(kExceptionObjectReg, 2161 __ sw(kExceptionObjectReg,
2150 Address(FP, exception_var().index() * kWordSize)); 2162 Address(FP, exception_var().index() * kWordSize));
2151 __ sw(kStackTraceObjectReg, 2163 __ sw(kStackTraceObjectReg,
2152 Address(FP, stacktrace_var().index() * kWordSize)); 2164 Address(FP, stacktrace_var().index() * kWordSize));
2153
2154 __ GetNextPC(CMPRES, TMP);
2155
2156 // Calculate offset of pool pointer from the PC.
2157 const intptr_t object_pool_pc_dist =
2158 Instructions::HeaderSize() - Instructions::object_pool_offset() +
2159 compiler->assembler()->CodeSize() - 1 * Instr::kInstrSize;
2160
2161 __ LoadFromOffset(PP, CMPRES, -object_pool_pc_dist);
2162 } 2165 }
2163 2166
2164 2167
2165 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const { 2168 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const {
2166 const intptr_t kNumInputs = 0; 2169 const intptr_t kNumInputs = 0;
2167 const intptr_t kNumTemps = 1; 2170 const intptr_t kNumTemps = 1;
2168 LocationSummary* summary = 2171 LocationSummary* summary =
2169 new LocationSummary(kNumInputs, 2172 new LocationSummary(kNumInputs,
2170 kNumTemps, 2173 kNumTemps,
2171 LocationSummary::kCallOnSlowPath); 2174 LocationSummary::kCallOnSlowPath);
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after
3880 compiler->GenerateCall(token_pos(), 3883 compiler->GenerateCall(token_pos(),
3881 &label, 3884 &label,
3882 PcDescriptors::kOther, 3885 PcDescriptors::kOther,
3883 locs()); 3886 locs());
3884 __ Drop(2); // Discard type arguments and receiver. 3887 __ Drop(2); // Discard type arguments and receiver.
3885 } 3888 }
3886 3889
3887 } // namespace dart 3890 } // namespace dart
3888 3891
3889 #endif // defined TARGET_ARCH_MIPS 3892 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698