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

Side by Side Diff: runtime/vm/flow_graph_compiler_x64.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, 5 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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 __ cmpq(RCX, RBX); 1003 __ cmpq(RCX, RBX);
1004 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump); 1004 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump);
1005 } 1005 }
1006 } 1006 }
1007 1007
1008 __ Bind(&wrong_num_arguments); 1008 __ Bind(&wrong_num_arguments);
1009 if (function.IsClosureFunction()) { 1009 if (function.IsClosureFunction()) {
1010 // Invoke noSuchMethod function passing "call" as the original name. 1010 // Invoke noSuchMethod function passing "call" as the original name.
1011 const int kNumArgsChecked = 1; 1011 const int kNumArgsChecked = 1;
1012 const ICData& ic_data = ICData::ZoneHandle( 1012 const ICData& ic_data = ICData::ZoneHandle(
1013 ICData::New(function, Symbols::Call(), Object::null_array(), 1013 ICData::New(function, Symbols::Call(), Object::empty_array(),
1014 Isolate::kNoDeoptId, kNumArgsChecked)); 1014 Isolate::kNoDeoptId, kNumArgsChecked));
1015 __ LoadObject(RBX, ic_data); 1015 __ LoadObject(RBX, ic_data);
1016 __ LeaveFrame(); // The arguments are still on the stack. 1016 __ LeaveFrame(); // The arguments are still on the stack.
1017 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); 1017 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel());
1018 // The noSuchMethod call may return to the caller, but not here. 1018 // The noSuchMethod call may return to the caller, but not here.
1019 __ int3(); 1019 __ int3();
1020 } else if (check_correct_named_args) { 1020 } else if (check_correct_named_args) {
1021 __ Stop("Wrong arguments"); 1021 __ Stop("Wrong arguments");
1022 } 1022 }
1023 1023
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 __ Bind(&wrong_num_arguments); 1157 __ Bind(&wrong_num_arguments);
1158 if (function.IsClosureFunction()) { 1158 if (function.IsClosureFunction()) {
1159 // Invoke noSuchMethod function passing the original function name. 1159 // Invoke noSuchMethod function passing the original function name.
1160 // For closure functions, use "call" as the original name. 1160 // For closure functions, use "call" as the original name.
1161 const String& name = 1161 const String& name =
1162 String::Handle(function.IsClosureFunction() 1162 String::Handle(function.IsClosureFunction()
1163 ? Symbols::Call().raw() 1163 ? Symbols::Call().raw()
1164 : function.name()); 1164 : function.name());
1165 const int kNumArgsChecked = 1; 1165 const int kNumArgsChecked = 1;
1166 const ICData& ic_data = ICData::ZoneHandle( 1166 const ICData& ic_data = ICData::ZoneHandle(
1167 ICData::New(function, name, Object::null_array(), 1167 ICData::New(function, name, Object::empty_array(),
1168 Isolate::kNoDeoptId, kNumArgsChecked)); 1168 Isolate::kNoDeoptId, kNumArgsChecked));
1169 __ LoadObject(RBX, ic_data); 1169 __ LoadObject(RBX, ic_data);
1170 __ LeaveFrame(); // The arguments are still on the stack. 1170 __ LeaveFrame(); // The arguments are still on the stack.
1171 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); 1171 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel());
1172 // The noSuchMethod call may return to the caller, but not here. 1172 // The noSuchMethod call may return to the caller, but not here.
1173 __ int3(); 1173 __ int3();
1174 } else { 1174 } else {
1175 __ Stop("Wrong number of arguments"); 1175 __ Stop("Wrong number of arguments");
1176 } 1176 }
1177 __ Bind(&correct_num_arguments); 1177 __ Bind(&correct_num_arguments);
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 __ movups(reg, Address(RSP, 0)); 1886 __ movups(reg, Address(RSP, 0));
1887 __ addq(RSP, Immediate(kFpuRegisterSize)); 1887 __ addq(RSP, Immediate(kFpuRegisterSize));
1888 } 1888 }
1889 1889
1890 1890
1891 #undef __ 1891 #undef __
1892 1892
1893 } // namespace dart 1893 } // namespace dart
1894 1894
1895 #endif // defined TARGET_ARCH_X64 1895 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698