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

Side by Side Diff: runtime/vm/flow_graph_compiler_x64.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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 bool push_emitted = false; 796 bool push_emitted = false;
797 const intptr_t num_non_copied_params = flow_graph().num_non_copied_params(); 797 const intptr_t num_non_copied_params = flow_graph().num_non_copied_params();
798 const intptr_t param_base = kParamEndSlotFromFp + num_non_copied_params; 798 const intptr_t param_base = kParamEndSlotFromFp + num_non_copied_params;
799 for (; i < num_non_copied_params; ++i) { 799 for (; i < num_non_copied_params; ++i) {
800 if ((*idefs)[i]->IsConstant()) continue; // Common constants 800 if ((*idefs)[i]->IsConstant()) continue; // Common constants
801 Location loc = env->LocationAt(i); 801 Location loc = env->LocationAt(i);
802 EmitTrySyncMove((param_base - i) * kWordSize, loc, &push_emitted); 802 EmitTrySyncMove((param_base - i) * kWordSize, loc, &push_emitted);
803 } 803 }
804 804
805 // Process locals. Skip exception_var and stacktrace_var. 805 // Process locals. Skip exception_var and stacktrace_var.
806 CatchEntryInstr* catch_entry = catch_block->next()->AsCatchEntry();
807 intptr_t local_base = kFirstLocalSlotFromFp + num_non_copied_params; 806 intptr_t local_base = kFirstLocalSlotFromFp + num_non_copied_params;
808 intptr_t ex_idx = local_base - catch_entry->exception_var().index(); 807 intptr_t ex_idx = local_base - catch_block->exception_var().index();
809 intptr_t st_idx = local_base - catch_entry->stacktrace_var().index(); 808 intptr_t st_idx = local_base - catch_block->stacktrace_var().index();
810 for (; i < flow_graph().variable_count(); ++i) { 809 for (; i < flow_graph().variable_count(); ++i) {
811 if (i == ex_idx || i == st_idx) continue; 810 if (i == ex_idx || i == st_idx) continue;
812 if ((*idefs)[i]->IsConstant()) continue; 811 if ((*idefs)[i]->IsConstant()) continue;
813 Location loc = env->LocationAt(i); 812 Location loc = env->LocationAt(i);
814 EmitTrySyncMove((local_base - i) * kWordSize, loc, &push_emitted); 813 EmitTrySyncMove((local_base - i) * kWordSize, loc, &push_emitted);
815 // Update safepoint bitmap to indicate that the target location 814 // Update safepoint bitmap to indicate that the target location
816 // now contains a pointer. 815 // now contains a pointer.
817 instr->locs()->stack_bitmap()->Set(i - num_non_copied_params, true); 816 instr->locs()->stack_bitmap()->Set(i - num_non_copied_params, true);
818 } 817 }
819 if (push_emitted) { 818 if (push_emitted) {
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 __ movups(reg, Address(RSP, 0)); 1889 __ movups(reg, Address(RSP, 0));
1891 __ addq(RSP, Immediate(kFpuRegisterSize)); 1890 __ addq(RSP, Immediate(kFpuRegisterSize));
1892 } 1891 }
1893 1892
1894 1893
1895 #undef __ 1894 #undef __
1896 1895
1897 } // namespace dart 1896 } // namespace dart
1898 1897
1899 #endif // defined TARGET_ARCH_X64 1898 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698