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

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

Issue 20755004: Make sure that ICData always contains valid data (non-null values). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 // Check that T2 equals T1, i.e. no named arguments passed. 1015 // Check that T2 equals T1, i.e. no named arguments passed.
1016 __ beq(T2, T1, &all_arguments_processed); 1016 __ beq(T2, T1, &all_arguments_processed);
1017 } 1017 }
1018 } 1018 }
1019 1019
1020 __ Bind(&wrong_num_arguments); 1020 __ Bind(&wrong_num_arguments);
1021 if (function.IsClosureFunction()) { 1021 if (function.IsClosureFunction()) {
1022 // Invoke noSuchMethod function passing "call" as the original name. 1022 // Invoke noSuchMethod function passing "call" as the original name.
1023 const int kNumArgsChecked = 1; 1023 const int kNumArgsChecked = 1;
1024 const ICData& ic_data = ICData::ZoneHandle( 1024 const ICData& ic_data = ICData::ZoneHandle(
1025 ICData::New(function, Symbols::Call(), Object::null_array(), 1025 ICData::New(function, Symbols::Call(), Object::empty_array(),
1026 Isolate::kNoDeoptId, kNumArgsChecked)); 1026 Isolate::kNoDeoptId, kNumArgsChecked));
1027 __ LoadObject(S5, ic_data); 1027 __ LoadObject(S5, ic_data);
1028 __ LeaveDartFrame(); // The arguments are still on the stack. 1028 __ LeaveDartFrame(); // The arguments are still on the stack.
1029 __ Branch(&StubCode::CallNoSuchMethodFunctionLabel()); 1029 __ Branch(&StubCode::CallNoSuchMethodFunctionLabel());
1030 // The noSuchMethod call may return to the caller, but not here. 1030 // The noSuchMethod call may return to the caller, but not here.
1031 __ break_(0); 1031 __ break_(0);
1032 } else if (check_correct_named_args) { 1032 } else if (check_correct_named_args) {
1033 __ Stop("Wrong arguments"); 1033 __ Stop("Wrong arguments");
1034 } 1034 }
1035 1035
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 __ Bind(&wrong_num_arguments); 1206 __ Bind(&wrong_num_arguments);
1207 if (function.IsClosureFunction()) { 1207 if (function.IsClosureFunction()) {
1208 // Invoke noSuchMethod function passing the original function name. 1208 // Invoke noSuchMethod function passing the original function name.
1209 // For closure functions, use "call" as the original name. 1209 // For closure functions, use "call" as the original name.
1210 const String& name = 1210 const String& name =
1211 String::Handle(function.IsClosureFunction() 1211 String::Handle(function.IsClosureFunction()
1212 ? Symbols::Call().raw() 1212 ? Symbols::Call().raw()
1213 : function.name()); 1213 : function.name());
1214 const int kNumArgsChecked = 1; 1214 const int kNumArgsChecked = 1;
1215 const ICData& ic_data = ICData::ZoneHandle( 1215 const ICData& ic_data = ICData::ZoneHandle(
1216 ICData::New(function, name, Object::null_array(), 1216 ICData::New(function, name, Object::empty_array(),
1217 Isolate::kNoDeoptId, kNumArgsChecked)); 1217 Isolate::kNoDeoptId, kNumArgsChecked));
1218 __ LoadObject(S5, ic_data); 1218 __ LoadObject(S5, ic_data);
1219 __ LeaveDartFrame(); // The arguments are still on the stack. 1219 __ LeaveDartFrame(); // The arguments are still on the stack.
1220 __ Branch(&StubCode::CallNoSuchMethodFunctionLabel()); 1220 __ Branch(&StubCode::CallNoSuchMethodFunctionLabel());
1221 // The noSuchMethod call may return to the caller, but not here. 1221 // The noSuchMethod call may return to the caller, but not here.
1222 __ break_(0); 1222 __ break_(0);
1223 } else { 1223 } else {
1224 __ Stop("Wrong number of arguments"); 1224 __ Stop("Wrong number of arguments");
1225 } 1225 }
1226 __ Bind(&correct_num_arguments); 1226 __ Bind(&correct_num_arguments);
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 __ AddImmediate(SP, kDoubleSize); 1999 __ AddImmediate(SP, kDoubleSize);
2000 } 2000 }
2001 2001
2002 2002
2003 #undef __ 2003 #undef __
2004 2004
2005 2005
2006 } // namespace dart 2006 } // namespace dart
2007 2007
2008 #endif // defined TARGET_ARCH_MIPS 2008 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698