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

Side by Side Diff: runtime/vm/intermediate_language_x64.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_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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 kConditionTypeErrorRuntimeEntry, 223 kConditionTypeErrorRuntimeEntry,
224 locs()); 224 locs());
225 // We should never return here. 225 // We should never return here.
226 __ int3(); 226 __ int3();
227 __ Bind(&done); 227 __ Bind(&done);
228 } 228 }
229 ASSERT(obj == result); 229 ASSERT(obj == result);
230 } 230 }
231 231
232 232
233 LocationSummary* ArgumentDefinitionTestComp::MakeLocationSummary() const {
234 const intptr_t kNumInputs = 1;
235 const intptr_t kNumTemps = 0;
236 LocationSummary* locs =
237 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
238 locs->set_in(0, Location::RegisterLocation(RAX));
239 locs->set_out(Location::RegisterLocation(RAX));
240 return locs;
241 }
242
243
244 void ArgumentDefinitionTestComp::EmitNativeCode(FlowGraphCompiler* compiler) {
245 Register saved_args_desc = locs()->in(0).reg();
246 Register result = locs()->out().reg();
247
248 // Push the result place holder initialized to NULL.
249 __ PushObject(Object::ZoneHandle());
250 __ pushq(Immediate(Smi::RawValue(formal_parameter_index())));
251 __ PushObject(formal_parameter_name());
252 __ pushq(saved_args_desc);
253 compiler->GenerateCallRuntime(deopt_id(),
254 token_pos(),
255 kArgumentDefinitionTestRuntimeEntry,
256 locs());
257 __ Drop(3);
258 __ popq(result); // Pop bool result.
259 }
260
261
233 static Condition TokenKindToSmiCondition(Token::Kind kind) { 262 static Condition TokenKindToSmiCondition(Token::Kind kind) {
234 switch (kind) { 263 switch (kind) {
235 case Token::kEQ: return EQUAL; 264 case Token::kEQ: return EQUAL;
236 case Token::kNE: return NOT_EQUAL; 265 case Token::kNE: return NOT_EQUAL;
237 case Token::kLT: return LESS; 266 case Token::kLT: return LESS;
238 case Token::kGT: return GREATER; 267 case Token::kGT: return GREATER;
239 case Token::kLTE: return LESS_EQUAL; 268 case Token::kLTE: return LESS_EQUAL;
240 case Token::kGTE: return GREATER_EQUAL; 269 case Token::kGTE: return GREATER_EQUAL;
241 default: 270 default:
242 UNREACHABLE(); 271 UNREACHABLE();
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 } 2256 }
2228 __ j(ABOVE_EQUAL, deopt); 2257 __ j(ABOVE_EQUAL, deopt);
2229 } 2258 }
2230 2259
2231 2260
2232 } // namespace dart 2261 } // namespace dart
2233 2262
2234 #undef __ 2263 #undef __
2235 2264
2236 #endif // defined TARGET_ARCH_X64 2265 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698