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

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.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
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 __ cmpl(ECX, EBX); 1009 __ cmpl(ECX, EBX);
1010 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump); 1010 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump);
1011 } 1011 }
1012 } 1012 }
1013 1013
1014 __ Bind(&wrong_num_arguments); 1014 __ Bind(&wrong_num_arguments);
1015 if (function.IsClosureFunction()) { 1015 if (function.IsClosureFunction()) {
1016 // Invoke noSuchMethod function passing "call" as the original name. 1016 // Invoke noSuchMethod function passing "call" as the original name.
1017 const int kNumArgsChecked = 1; 1017 const int kNumArgsChecked = 1;
1018 const ICData& ic_data = ICData::ZoneHandle( 1018 const ICData& ic_data = ICData::ZoneHandle(
1019 ICData::New(function, Symbols::Call(), Object::null_array(), 1019 ICData::New(function, Symbols::Call(), Object::empty_array(),
1020 Isolate::kNoDeoptId, kNumArgsChecked)); 1020 Isolate::kNoDeoptId, kNumArgsChecked));
1021 __ LoadObject(ECX, ic_data); 1021 __ LoadObject(ECX, ic_data);
1022 __ LeaveFrame(); // The arguments are still on the stack. 1022 __ LeaveFrame(); // The arguments are still on the stack.
1023 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); 1023 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel());
1024 // The noSuchMethod call may return to the caller, but not here. 1024 // The noSuchMethod call may return to the caller, but not here.
1025 __ int3(); 1025 __ int3();
1026 } else if (check_correct_named_args) { 1026 } else if (check_correct_named_args) {
1027 __ Stop("Wrong arguments"); 1027 __ Stop("Wrong arguments");
1028 } 1028 }
1029 1029
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 __ Bind(&wrong_num_arguments); 1162 __ Bind(&wrong_num_arguments);
1163 if (function.IsClosureFunction()) { 1163 if (function.IsClosureFunction()) {
1164 // Invoke noSuchMethod function passing the original function name. 1164 // Invoke noSuchMethod function passing the original function name.
1165 // For closure functions, use "call" as the original name. 1165 // For closure functions, use "call" as the original name.
1166 const String& name = 1166 const String& name =
1167 String::Handle(function.IsClosureFunction() 1167 String::Handle(function.IsClosureFunction()
1168 ? Symbols::Call().raw() 1168 ? Symbols::Call().raw()
1169 : function.name()); 1169 : function.name());
1170 const int kNumArgsChecked = 1; 1170 const int kNumArgsChecked = 1;
1171 const ICData& ic_data = ICData::ZoneHandle( 1171 const ICData& ic_data = ICData::ZoneHandle(
1172 ICData::New(function, name, Object::null_array(), 1172 ICData::New(function, name, Object::empty_array(),
1173 Isolate::kNoDeoptId, kNumArgsChecked)); 1173 Isolate::kNoDeoptId, kNumArgsChecked));
1174 __ LoadObject(ECX, ic_data); 1174 __ LoadObject(ECX, ic_data);
1175 __ LeaveFrame(); // The arguments are still on the stack. 1175 __ LeaveFrame(); // The arguments are still on the stack.
1176 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); 1176 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel());
1177 // The noSuchMethod call may return to the caller, but not here. 1177 // The noSuchMethod call may return to the caller, but not here.
1178 __ int3(); 1178 __ int3();
1179 } else { 1179 } else {
1180 __ Stop("Wrong number of arguments"); 1180 __ Stop("Wrong number of arguments");
1181 } 1181 }
1182 __ Bind(&correct_num_arguments); 1182 __ Bind(&correct_num_arguments);
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1907 __ movups(reg, Address(ESP, 0)); 1907 __ movups(reg, Address(ESP, 0));
1908 __ addl(ESP, Immediate(kFpuRegisterSize)); 1908 __ addl(ESP, Immediate(kFpuRegisterSize));
1909 } 1909 }
1910 1910
1911 1911
1912 #undef __ 1912 #undef __
1913 1913
1914 } // namespace dart 1914 } // namespace dart
1915 1915
1916 #endif // defined TARGET_ARCH_IA32 1916 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698