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

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

Issue 10915022: Implement argument definition test in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 kConditionTypeErrorRuntimeEntry, 214 kConditionTypeErrorRuntimeEntry,
215 locs()); 215 locs());
216 // We should never return here. 216 // We should never return here.
217 __ int3(); 217 __ int3();
218 __ Bind(&done); 218 __ Bind(&done);
219 } 219 }
220 ASSERT(obj == result); 220 ASSERT(obj == result);
221 } 221 }
222 222
223 223
224 LocationSummary* ArgumentDefinitionTestComp::MakeLocationSummary() const {
225 const intptr_t kNumInputs = 1;
226 const intptr_t kNumTemps = 0;
227 LocationSummary* locs =
228 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
229 locs->set_in(0, Location::RegisterLocation(EAX));
230 locs->set_out(Location::RegisterLocation(EAX));
231 return locs;
232 }
233
234
235 void ArgumentDefinitionTestComp::EmitNativeCode(FlowGraphCompiler* compiler) {
236 Register saved_args_desc = locs()->in(0).reg();
237 Register result = locs()->out().reg();
238
239 // Push the result place holder initialized to NULL.
240 __ PushObject(Object::ZoneHandle());
241 __ pushl(Immediate(Smi::RawValue(formal_parameter_index())));
242 __ PushObject(formal_parameter_name());
243 __ pushl(saved_args_desc);
244 compiler->GenerateCallRuntime(deopt_id(),
245 token_pos(),
246 kArgumentDefinitionTestRuntimeEntry,
247 locs());
248 __ Drop(3);
249 __ popl(result); // Pop bool result.
250 }
251
252
224 static Condition TokenKindToSmiCondition(Token::Kind kind) { 253 static Condition TokenKindToSmiCondition(Token::Kind kind) {
225 switch (kind) { 254 switch (kind) {
226 case Token::kEQ: return EQUAL; 255 case Token::kEQ: return EQUAL;
227 case Token::kNE: return NOT_EQUAL; 256 case Token::kNE: return NOT_EQUAL;
228 case Token::kLT: return LESS; 257 case Token::kLT: return LESS;
229 case Token::kGT: return GREATER; 258 case Token::kGT: return GREATER;
230 case Token::kLTE: return LESS_EQUAL; 259 case Token::kLTE: return LESS_EQUAL;
231 case Token::kGTE: return GREATER_EQUAL; 260 case Token::kGTE: return GREATER_EQUAL;
232 default: 261 default:
233 UNREACHABLE(); 262 UNREACHABLE();
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 } 2242 }
2214 __ j(ABOVE_EQUAL, deopt); 2243 __ j(ABOVE_EQUAL, deopt);
2215 } 2244 }
2216 2245
2217 2246
2218 } // namespace dart 2247 } // namespace dart
2219 2248
2220 #undef __ 2249 #undef __
2221 2250
2222 #endif // defined TARGET_ARCH_X64 2251 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698