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

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

Issue 296003013: - Reduce the number of Isolate::Current() calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 10 matching lines...) Expand all
21 21
22 namespace dart { 22 namespace dart {
23 23
24 DECLARE_FLAG(int, optimization_counter_threshold); 24 DECLARE_FLAG(int, optimization_counter_threshold);
25 DECLARE_FLAG(bool, propagate_ic_data); 25 DECLARE_FLAG(bool, propagate_ic_data);
26 DECLARE_FLAG(bool, use_osr); 26 DECLARE_FLAG(bool, use_osr);
27 27
28 // Generic summary for call instructions that have all arguments pushed 28 // Generic summary for call instructions that have all arguments pushed
29 // on the stack and return the result in a fixed register V0. 29 // on the stack and return the result in a fixed register V0.
30 LocationSummary* Instruction::MakeCallSummary() { 30 LocationSummary* Instruction::MakeCallSummary() {
31 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); 31 Isolate* isolate = Isolate::Current();
32 LocationSummary* result = new(isolate) LocationSummary(
33 isolate, 0, 0, LocationSummary::kCall);
32 result->set_out(0, Location::RegisterLocation(V0)); 34 result->set_out(0, Location::RegisterLocation(V0));
33 return result; 35 return result;
34 } 36 }
35 37
36 38
37 LocationSummary* PushArgumentInstr::MakeLocationSummary(bool opt) const { 39 LocationSummary* PushArgumentInstr::MakeLocationSummary(Isolate* isolate,
40 bool opt) const {
38 const intptr_t kNumInputs = 1; 41 const intptr_t kNumInputs = 1;
39 const intptr_t kNumTemps= 0; 42 const intptr_t kNumTemps= 0;
40 LocationSummary* locs = 43 LocationSummary* locs = new(isolate) LocationSummary(
41 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 44 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
42 locs->set_in(0, Location::AnyOrConstant(value())); 45 locs->set_in(0, Location::AnyOrConstant(value()));
43 return locs; 46 return locs;
44 } 47 }
45 48
46 49
47 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 50 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
48 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode 51 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
49 // where PushArgument is handled by BindInstr::EmitNativeCode. 52 // where PushArgument is handled by BindInstr::EmitNativeCode.
50 __ TraceSimMsg("PushArgumentInstr"); 53 __ TraceSimMsg("PushArgumentInstr");
51 if (compiler->is_optimizing()) { 54 if (compiler->is_optimizing()) {
52 Location value = locs()->in(0); 55 Location value = locs()->in(0);
53 if (value.IsRegister()) { 56 if (value.IsRegister()) {
54 __ Push(value.reg()); 57 __ Push(value.reg());
55 } else if (value.IsConstant()) { 58 } else if (value.IsConstant()) {
56 __ PushObject(value.constant()); 59 __ PushObject(value.constant());
57 } else { 60 } else {
58 ASSERT(value.IsStackSlot()); 61 ASSERT(value.IsStackSlot());
59 const intptr_t value_offset = value.ToStackSlotOffset(); 62 const intptr_t value_offset = value.ToStackSlotOffset();
60 __ LoadFromOffset(TMP, FP, value_offset); 63 __ LoadFromOffset(TMP, FP, value_offset);
61 __ Push(TMP); 64 __ Push(TMP);
62 } 65 }
63 } 66 }
64 } 67 }
65 68
66 69
67 LocationSummary* ReturnInstr::MakeLocationSummary(bool opt) const { 70 LocationSummary* ReturnInstr::MakeLocationSummary(Isolate* isolate,
71 bool opt) const {
68 const intptr_t kNumInputs = 1; 72 const intptr_t kNumInputs = 1;
69 const intptr_t kNumTemps = 0; 73 const intptr_t kNumTemps = 0;
70 LocationSummary* locs = 74 LocationSummary* locs = new(isolate) LocationSummary(
71 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 75 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
72 locs->set_in(0, Location::RegisterLocation(V0)); 76 locs->set_in(0, Location::RegisterLocation(V0));
73 return locs; 77 return locs;
74 } 78 }
75 79
76 80
77 // Attempt optimized compilation at return instruction instead of at the entry. 81 // Attempt optimized compilation at return instruction instead of at the entry.
78 // The entry needs to be patchable, no inlined objects are allowed in the area 82 // The entry needs to be patchable, no inlined objects are allowed in the area
79 // that will be overwritten by the patch instructions: a branch macro sequence. 83 // that will be overwritten by the patch instructions: a branch macro sequence.
80 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 84 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
81 __ TraceSimMsg("ReturnInstr"); 85 __ TraceSimMsg("ReturnInstr");
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 119 }
116 120
117 121
118 // Detect pattern when one value is zero and another is a power of 2. 122 // Detect pattern when one value is zero and another is a power of 2.
119 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { 123 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) {
120 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || 124 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) ||
121 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); 125 (Utils::IsPowerOfTwo(v2) && (v1 == 0));
122 } 126 }
123 127
124 128
125 LocationSummary* IfThenElseInstr::MakeLocationSummary(bool opt) const { 129 LocationSummary* IfThenElseInstr::MakeLocationSummary(Isolate* isolate,
126 comparison()->InitializeLocationSummary(opt); 130 bool opt) const {
131 comparison()->InitializeLocationSummary(isolate, opt);
127 return comparison()->locs(); 132 return comparison()->locs();
128 } 133 }
129 134
130 135
131 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 136 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
132 const Register result = locs()->out(0).reg(); 137 const Register result = locs()->out(0).reg();
133 138
134 Location left = locs()->in(0); 139 Location left = locs()->in(0);
135 Location right = locs()->in(1); 140 Location right = locs()->in(1);
136 ASSERT(!left.IsConstant() || !right.IsConstant()); 141 ASSERT(!left.IsConstant() || !right.IsConstant());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 const int32_t val = 202 const int32_t val =
198 Smi::RawValue(true_value) - Smi::RawValue(false_value); 203 Smi::RawValue(true_value) - Smi::RawValue(false_value);
199 __ AndImmediate(result, result, val); 204 __ AndImmediate(result, result, val);
200 if (false_value != 0) { 205 if (false_value != 0) {
201 __ AddImmediate(result, result, Smi::RawValue(false_value)); 206 __ AddImmediate(result, result, Smi::RawValue(false_value));
202 } 207 }
203 } 208 }
204 } 209 }
205 210
206 211
207 LocationSummary* ClosureCallInstr::MakeLocationSummary(bool opt) const { 212 LocationSummary* ClosureCallInstr::MakeLocationSummary(Isolate* isolate,
213 bool opt) const {
208 const intptr_t kNumInputs = 1; 214 const intptr_t kNumInputs = 1;
209 const intptr_t kNumTemps = 0; 215 const intptr_t kNumTemps = 0;
210 LocationSummary* summary = 216 LocationSummary* summary = new(isolate) LocationSummary(
211 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 217 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
212 summary->set_in(0, Location::RegisterLocation(T0)); // Function. 218 summary->set_in(0, Location::RegisterLocation(T0)); // Function.
213 summary->set_out(0, Location::RegisterLocation(V0)); 219 summary->set_out(0, Location::RegisterLocation(V0));
214 return summary; 220 return summary;
215 } 221 }
216 222
217 223
218 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 224 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
219 // Load arguments descriptor in S4. 225 // Load arguments descriptor in S4.
220 int argument_count = ArgumentCount(); 226 int argument_count = ArgumentCount();
221 const Array& arguments_descriptor = 227 const Array& arguments_descriptor =
(...skipping 23 matching lines...) Expand all
245 // Add deoptimization continuation point after the call and before the 251 // Add deoptimization continuation point after the call and before the
246 // arguments are removed. 252 // arguments are removed.
247 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, 253 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
248 deopt_id_after, 254 deopt_id_after,
249 token_pos()); 255 token_pos());
250 } 256 }
251 __ Drop(argument_count); 257 __ Drop(argument_count);
252 } 258 }
253 259
254 260
255 LocationSummary* LoadLocalInstr::MakeLocationSummary(bool opt) const { 261 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate,
262 bool opt) const {
256 return LocationSummary::Make(0, 263 return LocationSummary::Make(0,
257 Location::RequiresRegister(), 264 Location::RequiresRegister(),
258 LocationSummary::kNoCall); 265 LocationSummary::kNoCall);
259 } 266 }
260 267
261 268
262 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 269 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
263 __ TraceSimMsg("LoadLocalInstr"); 270 __ TraceSimMsg("LoadLocalInstr");
264 Register result = locs()->out(0).reg(); 271 Register result = locs()->out(0).reg();
265 __ lw(result, Address(FP, local().index() * kWordSize)); 272 __ lw(result, Address(FP, local().index() * kWordSize));
266 } 273 }
267 274
268 275
269 LocationSummary* StoreLocalInstr::MakeLocationSummary(bool opt) const { 276 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate,
277 bool opt) const {
270 return LocationSummary::Make(1, 278 return LocationSummary::Make(1,
271 Location::SameAsFirstInput(), 279 Location::SameAsFirstInput(),
272 LocationSummary::kNoCall); 280 LocationSummary::kNoCall);
273 } 281 }
274 282
275 283
276 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 284 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
277 __ TraceSimMsg("StoreLocalInstr"); 285 __ TraceSimMsg("StoreLocalInstr");
278 Register value = locs()->in(0).reg(); 286 Register value = locs()->in(0).reg();
279 Register result = locs()->out(0).reg(); 287 Register result = locs()->out(0).reg();
280 ASSERT(result == value); // Assert that register assignment is correct. 288 ASSERT(result == value); // Assert that register assignment is correct.
281 __ sw(value, Address(FP, local().index() * kWordSize)); 289 __ sw(value, Address(FP, local().index() * kWordSize));
282 } 290 }
283 291
284 292
285 LocationSummary* ConstantInstr::MakeLocationSummary(bool opt) const { 293 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate,
294 bool opt) const {
286 return LocationSummary::Make(0, 295 return LocationSummary::Make(0,
287 Location::RequiresRegister(), 296 Location::RequiresRegister(),
288 LocationSummary::kNoCall); 297 LocationSummary::kNoCall);
289 } 298 }
290 299
291 300
292 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 301 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
293 // The register allocator drops constant definitions that have no uses. 302 // The register allocator drops constant definitions that have no uses.
294 if (!locs()->out(0).IsInvalid()) { 303 if (!locs()->out(0).IsInvalid()) {
295 __ TraceSimMsg("ConstantInstr"); 304 __ TraceSimMsg("ConstantInstr");
296 Register result = locs()->out(0).reg(); 305 Register result = locs()->out(0).reg();
297 __ LoadObject(result, value()); 306 __ LoadObject(result, value());
298 } 307 }
299 } 308 }
300 309
301 310
302 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const { 311 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate,
312 bool opt) const {
303 const intptr_t kNumInputs = 0; 313 const intptr_t kNumInputs = 0;
304 const intptr_t kNumTemps = 1; 314 const intptr_t kNumTemps = 1;
305 LocationSummary* locs = 315 LocationSummary* locs = new(isolate) LocationSummary(
306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 316 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
307 locs->set_out(0, Location::RequiresFpuRegister()); 317 locs->set_out(0, Location::RequiresFpuRegister());
308 locs->set_temp(0, Location::RequiresRegister()); 318 locs->set_temp(0, Location::RequiresRegister());
309 return locs; 319 return locs;
310 } 320 }
311 321
312 322
313 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 323 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
314 // The register allocator drops constant definitions that have no uses. 324 // The register allocator drops constant definitions that have no uses.
315 if (!locs()->out(0).IsInvalid()) { 325 if (!locs()->out(0).IsInvalid()) {
316 ASSERT(value().IsDouble()); 326 ASSERT(value().IsDouble());
317 const Register const_value = locs()->temp(0).reg(); 327 const Register const_value = locs()->temp(0).reg();
318 const DRegister result = locs()->out(0).fpu_reg(); 328 const DRegister result = locs()->out(0).fpu_reg();
319 __ LoadObject(const_value, value()); 329 __ LoadObject(const_value, value());
320 __ LoadDFromOffset(result, const_value, 330 __ LoadDFromOffset(result, const_value,
321 Double::value_offset() - kHeapObjectTag); 331 Double::value_offset() - kHeapObjectTag);
322 } 332 }
323 } 333 }
324 334
325 335
326 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { 336 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Isolate* isolate,
337 bool opt) const {
327 const intptr_t kNumInputs = 3; 338 const intptr_t kNumInputs = 3;
328 const intptr_t kNumTemps = 0; 339 const intptr_t kNumTemps = 0;
329 LocationSummary* summary = 340 LocationSummary* summary = new(isolate) LocationSummary(
330 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 341 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
331 summary->set_in(0, Location::RegisterLocation(A0)); // Value. 342 summary->set_in(0, Location::RegisterLocation(A0)); // Value.
332 summary->set_in(1, Location::RegisterLocation(A2)); // Instantiator. 343 summary->set_in(1, Location::RegisterLocation(A2)); // Instantiator.
333 summary->set_in(2, Location::RegisterLocation(A1)); // Type arguments. 344 summary->set_in(2, Location::RegisterLocation(A1)); // Type arguments.
334 summary->set_out(0, Location::RegisterLocation(A0)); 345 summary->set_out(0, Location::RegisterLocation(A0));
335 return summary; 346 return summary;
336 } 347 }
337 348
338 349
339 LocationSummary* AssertBooleanInstr::MakeLocationSummary(bool opt) const { 350 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Isolate* isolate,
351 bool opt) const {
340 const intptr_t kNumInputs = 1; 352 const intptr_t kNumInputs = 1;
341 const intptr_t kNumTemps = 0; 353 const intptr_t kNumTemps = 0;
342 LocationSummary* locs = 354 LocationSummary* locs = new(isolate) LocationSummary(
343 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 355 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
344 locs->set_in(0, Location::RegisterLocation(A0)); 356 locs->set_in(0, Location::RegisterLocation(A0));
345 locs->set_out(0, Location::RegisterLocation(A0)); 357 locs->set_out(0, Location::RegisterLocation(A0));
346 return locs; 358 return locs;
347 } 359 }
348 360
349 361
350 static void EmitAssertBoolean(Register reg, 362 static void EmitAssertBoolean(Register reg,
351 intptr_t token_pos, 363 intptr_t token_pos,
352 intptr_t deopt_id, 364 intptr_t deopt_id,
353 LocationSummary* locs, 365 LocationSummary* locs,
(...skipping 20 matching lines...) Expand all
374 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 386 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
375 Register obj = locs()->in(0).reg(); 387 Register obj = locs()->in(0).reg();
376 Register result = locs()->out(0).reg(); 388 Register result = locs()->out(0).reg();
377 389
378 __ TraceSimMsg("AssertBooleanInstr"); 390 __ TraceSimMsg("AssertBooleanInstr");
379 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler); 391 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler);
380 ASSERT(obj == result); 392 ASSERT(obj == result);
381 } 393 }
382 394
383 395
384 LocationSummary* EqualityCompareInstr::MakeLocationSummary(bool opt) const { 396 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Isolate* isolate,
397 bool opt) const {
385 const intptr_t kNumInputs = 2; 398 const intptr_t kNumInputs = 2;
386 if (operation_cid() == kMintCid) { 399 if (operation_cid() == kMintCid) {
387 const intptr_t kNumTemps = 1; 400 const intptr_t kNumTemps = 1;
388 LocationSummary* locs = 401 LocationSummary* locs = new(isolate) LocationSummary(
389 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 402 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
390 locs->set_in(0, Location::RequiresFpuRegister()); 403 locs->set_in(0, Location::RequiresFpuRegister());
391 locs->set_in(1, Location::RequiresFpuRegister()); 404 locs->set_in(1, Location::RequiresFpuRegister());
392 locs->set_temp(0, Location::RequiresRegister()); 405 locs->set_temp(0, Location::RequiresRegister());
393 locs->set_out(0, Location::RequiresRegister()); 406 locs->set_out(0, Location::RequiresRegister());
394 return locs; 407 return locs;
395 } 408 }
396 if (operation_cid() == kDoubleCid) { 409 if (operation_cid() == kDoubleCid) {
397 const intptr_t kNumTemps = 0; 410 const intptr_t kNumTemps = 0;
398 LocationSummary* locs = 411 LocationSummary* locs = new(isolate) LocationSummary(
399 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 412 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
400 locs->set_in(0, Location::RequiresFpuRegister()); 413 locs->set_in(0, Location::RequiresFpuRegister());
401 locs->set_in(1, Location::RequiresFpuRegister()); 414 locs->set_in(1, Location::RequiresFpuRegister());
402 locs->set_out(0, Location::RequiresRegister()); 415 locs->set_out(0, Location::RequiresRegister());
403 return locs; 416 return locs;
404 } 417 }
405 if (operation_cid() == kSmiCid) { 418 if (operation_cid() == kSmiCid) {
406 const intptr_t kNumTemps = 0; 419 const intptr_t kNumTemps = 0;
407 LocationSummary* locs = 420 LocationSummary* locs = new(isolate) LocationSummary(
408 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 421 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
409 locs->set_in(0, Location::RegisterOrConstant(left())); 422 locs->set_in(0, Location::RegisterOrConstant(left()));
410 // Only one input can be a constant operand. The case of two constant 423 // Only one input can be a constant operand. The case of two constant
411 // operands should be handled by constant propagation. 424 // operands should be handled by constant propagation.
412 locs->set_in(1, locs->in(0).IsConstant() 425 locs->set_in(1, locs->in(0).IsConstant()
413 ? Location::RequiresRegister() 426 ? Location::RequiresRegister()
414 : Location::RegisterOrConstant(right())); 427 : Location::RegisterOrConstant(right()));
415 locs->set_out(0, Location::RequiresRegister()); 428 locs->set_out(0, Location::RequiresRegister());
416 return locs; 429 return locs;
417 } 430 }
418 UNREACHABLE(); 431 UNREACHABLE();
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 __ TraceSimMsg("EqualityCompareInstr"); 639 __ TraceSimMsg("EqualityCompareInstr");
627 __ Comment("EqualityCompareInstr:BranchCode"); 640 __ Comment("EqualityCompareInstr:BranchCode");
628 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ)); 641 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
629 642
630 BranchLabels labels = compiler->CreateBranchLabels(branch); 643 BranchLabels labels = compiler->CreateBranchLabels(branch);
631 Condition true_condition = EmitComparisonCode(compiler, labels); 644 Condition true_condition = EmitComparisonCode(compiler, labels);
632 EmitBranchOnCondition(compiler, true_condition, labels); 645 EmitBranchOnCondition(compiler, true_condition, labels);
633 } 646 }
634 647
635 648
636 LocationSummary* TestSmiInstr::MakeLocationSummary(bool opt) const { 649 LocationSummary* TestSmiInstr::MakeLocationSummary(Isolate* isolate,
650 bool opt) const {
637 const intptr_t kNumInputs = 2; 651 const intptr_t kNumInputs = 2;
638 const intptr_t kNumTemps = 0; 652 const intptr_t kNumTemps = 0;
639 LocationSummary* locs = 653 LocationSummary* locs = new(isolate) LocationSummary(
640 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 654 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
641 locs->set_in(0, Location::RequiresRegister()); 655 locs->set_in(0, Location::RequiresRegister());
642 // Only one input can be a constant operand. The case of two constant 656 // Only one input can be a constant operand. The case of two constant
643 // operands should be handled by constant propagation. 657 // operands should be handled by constant propagation.
644 locs->set_in(1, Location::RegisterOrConstant(right())); 658 locs->set_in(1, Location::RegisterOrConstant(right()));
645 return locs; 659 return locs;
646 } 660 }
647 661
648 662
649 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 663 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
650 BranchLabels labels) { 664 BranchLabels labels) {
(...skipping 20 matching lines...) Expand all
671 685
672 686
673 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, 687 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler,
674 BranchInstr* branch) { 688 BranchInstr* branch) {
675 BranchLabels labels = compiler->CreateBranchLabels(branch); 689 BranchLabels labels = compiler->CreateBranchLabels(branch);
676 Condition true_condition = EmitComparisonCode(compiler, labels); 690 Condition true_condition = EmitComparisonCode(compiler, labels);
677 EmitBranchOnCondition(compiler, true_condition, labels); 691 EmitBranchOnCondition(compiler, true_condition, labels);
678 } 692 }
679 693
680 694
681 LocationSummary* TestCidsInstr::MakeLocationSummary(bool opt) const { 695 LocationSummary* TestCidsInstr::MakeLocationSummary(Isolate* isolate,
696 bool opt) const {
682 const intptr_t kNumInputs = 1; 697 const intptr_t kNumInputs = 1;
683 const intptr_t kNumTemps = 1; 698 const intptr_t kNumTemps = 1;
684 LocationSummary* locs = 699 LocationSummary* locs = new(isolate) LocationSummary(
685 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 700 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
686 locs->set_in(0, Location::RequiresRegister()); 701 locs->set_in(0, Location::RequiresRegister());
687 locs->set_temp(0, Location::RequiresRegister()); 702 locs->set_temp(0, Location::RequiresRegister());
688 locs->set_out(0, Location::RequiresRegister()); 703 locs->set_out(0, Location::RequiresRegister());
689 return locs; 704 return locs;
690 } 705 }
691 706
692 707
693 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 708 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
694 BranchLabels labels) { 709 BranchLabels labels) {
695 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); 710 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT));
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 EmitComparisonCode(compiler, labels); 758 EmitComparisonCode(compiler, labels);
744 __ Bind(&is_false); 759 __ Bind(&is_false);
745 __ LoadObject(result_reg, Bool::False()); 760 __ LoadObject(result_reg, Bool::False());
746 __ b(&done); 761 __ b(&done);
747 __ Bind(&is_true); 762 __ Bind(&is_true);
748 __ LoadObject(result_reg, Bool::True()); 763 __ LoadObject(result_reg, Bool::True());
749 __ Bind(&done); 764 __ Bind(&done);
750 } 765 }
751 766
752 767
753 LocationSummary* RelationalOpInstr::MakeLocationSummary(bool opt) const { 768 LocationSummary* RelationalOpInstr::MakeLocationSummary(Isolate* isolate,
769 bool opt) const {
754 const intptr_t kNumInputs = 2; 770 const intptr_t kNumInputs = 2;
755 const intptr_t kNumTemps = 0; 771 const intptr_t kNumTemps = 0;
756 if (operation_cid() == kMintCid) { 772 if (operation_cid() == kMintCid) {
757 const intptr_t kNumTemps = 2; 773 const intptr_t kNumTemps = 2;
758 LocationSummary* locs = 774 LocationSummary* locs = new(isolate) LocationSummary(
759 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 775 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
760 locs->set_in(0, Location::RequiresFpuRegister()); 776 locs->set_in(0, Location::RequiresFpuRegister());
761 locs->set_in(1, Location::RequiresFpuRegister()); 777 locs->set_in(1, Location::RequiresFpuRegister());
762 locs->set_temp(0, Location::RequiresRegister()); 778 locs->set_temp(0, Location::RequiresRegister());
763 locs->set_temp(1, Location::RequiresRegister()); 779 locs->set_temp(1, Location::RequiresRegister());
764 locs->set_out(0, Location::RequiresRegister()); 780 locs->set_out(0, Location::RequiresRegister());
765 return locs; 781 return locs;
766 } 782 }
767 if (operation_cid() == kDoubleCid) { 783 if (operation_cid() == kDoubleCid) {
768 LocationSummary* summary = 784 LocationSummary* summary = new(isolate) LocationSummary(
769 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 785 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
770 summary->set_in(0, Location::RequiresFpuRegister()); 786 summary->set_in(0, Location::RequiresFpuRegister());
771 summary->set_in(1, Location::RequiresFpuRegister()); 787 summary->set_in(1, Location::RequiresFpuRegister());
772 summary->set_out(0, Location::RequiresRegister()); 788 summary->set_out(0, Location::RequiresRegister());
773 return summary; 789 return summary;
774 } 790 }
775 ASSERT(operation_cid() == kSmiCid); 791 ASSERT(operation_cid() == kSmiCid);
776 LocationSummary* summary = 792 LocationSummary* summary = new(isolate) LocationSummary(
777 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 793 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
778 summary->set_in(0, Location::RegisterOrConstant(left())); 794 summary->set_in(0, Location::RegisterOrConstant(left()));
779 // Only one input can be a constant operand. The case of two constant 795 // Only one input can be a constant operand. The case of two constant
780 // operands should be handled by constant propagation. 796 // operands should be handled by constant propagation.
781 summary->set_in(1, summary->in(0).IsConstant() 797 summary->set_in(1, summary->in(0).IsConstant()
782 ? Location::RequiresRegister() 798 ? Location::RequiresRegister()
783 : Location::RegisterOrConstant(right())); 799 : Location::RegisterOrConstant(right()));
784 summary->set_out(0, Location::RequiresRegister()); 800 summary->set_out(0, Location::RequiresRegister());
785 return summary; 801 return summary;
786 } 802 }
787 803
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, 835 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
820 BranchInstr* branch) { 836 BranchInstr* branch) {
821 __ TraceSimMsg("RelationalOpInstr"); 837 __ TraceSimMsg("RelationalOpInstr");
822 838
823 BranchLabels labels = compiler->CreateBranchLabels(branch); 839 BranchLabels labels = compiler->CreateBranchLabels(branch);
824 Condition true_condition = EmitComparisonCode(compiler, labels); 840 Condition true_condition = EmitComparisonCode(compiler, labels);
825 EmitBranchOnCondition(compiler, true_condition, labels); 841 EmitBranchOnCondition(compiler, true_condition, labels);
826 } 842 }
827 843
828 844
829 LocationSummary* NativeCallInstr::MakeLocationSummary(bool opt) const { 845 LocationSummary* NativeCallInstr::MakeLocationSummary(Isolate* isolate,
846 bool opt) const {
830 const intptr_t kNumInputs = 0; 847 const intptr_t kNumInputs = 0;
831 const intptr_t kNumTemps = 3; 848 const intptr_t kNumTemps = 3;
832 LocationSummary* locs = 849 LocationSummary* locs = new(isolate) LocationSummary(
833 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 850 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
834 locs->set_temp(0, Location::RegisterLocation(A1)); 851 locs->set_temp(0, Location::RegisterLocation(A1));
835 locs->set_temp(1, Location::RegisterLocation(A2)); 852 locs->set_temp(1, Location::RegisterLocation(A2));
836 locs->set_temp(2, Location::RegisterLocation(T5)); 853 locs->set_temp(2, Location::RegisterLocation(T5));
837 locs->set_out(0, Location::RegisterLocation(V0)); 854 locs->set_out(0, Location::RegisterLocation(V0));
838 return locs; 855 return locs;
839 } 856 }
840 857
841 858
842 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 859 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
843 __ TraceSimMsg("NativeCallInstr"); 860 __ TraceSimMsg("NativeCallInstr");
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 __ LoadImmediate(T5, entry); 898 __ LoadImmediate(T5, entry);
882 __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function())); 899 __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function()));
883 compiler->GenerateCall(token_pos(), 900 compiler->GenerateCall(token_pos(),
884 stub_entry, 901 stub_entry,
885 PcDescriptors::kOther, 902 PcDescriptors::kOther,
886 locs()); 903 locs());
887 __ Pop(result); 904 __ Pop(result);
888 } 905 }
889 906
890 907
891 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(bool opt) const { 908 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate,
909 bool opt) const {
892 const intptr_t kNumInputs = 1; 910 const intptr_t kNumInputs = 1;
893 // TODO(fschneider): Allow immediate operands for the char code. 911 // TODO(fschneider): Allow immediate operands for the char code.
894 return LocationSummary::Make(kNumInputs, 912 return LocationSummary::Make(kNumInputs,
895 Location::RequiresRegister(), 913 Location::RequiresRegister(),
896 LocationSummary::kNoCall); 914 LocationSummary::kNoCall);
897 } 915 }
898 916
899 917
900 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 918 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
901 Register char_code = locs()->in(0).reg(); 919 Register char_code = locs()->in(0).reg();
902 Register result = locs()->out(0).reg(); 920 Register result = locs()->out(0).reg();
903 921
904 __ TraceSimMsg("StringFromCharCodeInstr"); 922 __ TraceSimMsg("StringFromCharCodeInstr");
905 923
906 __ LoadImmediate(result, 924 __ LoadImmediate(result,
907 reinterpret_cast<uword>(Symbols::PredefinedAddress())); 925 reinterpret_cast<uword>(Symbols::PredefinedAddress()));
908 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); 926 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize);
909 __ sll(TMP, char_code, 1); // Char code is a smi. 927 __ sll(TMP, char_code, 1); // Char code is a smi.
910 __ addu(TMP, TMP, result); 928 __ addu(TMP, TMP, result);
911 __ lw(result, Address(TMP)); 929 __ lw(result, Address(TMP));
912 } 930 }
913 931
914 932
915 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(bool opt) const { 933 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate,
934 bool opt) const {
916 const intptr_t kNumInputs = 1; 935 const intptr_t kNumInputs = 1;
917 return LocationSummary::Make(kNumInputs, 936 return LocationSummary::Make(kNumInputs,
918 Location::RequiresRegister(), 937 Location::RequiresRegister(),
919 LocationSummary::kNoCall); 938 LocationSummary::kNoCall);
920 } 939 }
921 940
922 941
923 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 942 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
924 __ TraceSimMsg("StringToCharCodeInstr"); 943 __ TraceSimMsg("StringToCharCodeInstr");
925 944
926 ASSERT(cid_ == kOneByteStringCid); 945 ASSERT(cid_ == kOneByteStringCid);
927 Register str = locs()->in(0).reg(); 946 Register str = locs()->in(0).reg();
928 Register result = locs()->out(0).reg(); 947 Register result = locs()->out(0).reg();
929 Label done, is_one; 948 Label done, is_one;
930 __ lw(result, FieldAddress(str, String::length_offset())); 949 __ lw(result, FieldAddress(str, String::length_offset()));
931 __ BranchEqual(result, Smi::RawValue(1), &is_one); 950 __ BranchEqual(result, Smi::RawValue(1), &is_one);
932 __ LoadImmediate(result, Smi::RawValue(-1)); 951 __ LoadImmediate(result, Smi::RawValue(-1));
933 __ b(&done); 952 __ b(&done);
934 __ Bind(&is_one); 953 __ Bind(&is_one);
935 __ lbu(result, FieldAddress(str, OneByteString::data_offset())); 954 __ lbu(result, FieldAddress(str, OneByteString::data_offset()));
936 __ SmiTag(result); 955 __ SmiTag(result);
937 __ Bind(&done); 956 __ Bind(&done);
938 } 957 }
939 958
940 959
941 LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const { 960 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Isolate* isolate,
961 bool opt) const {
942 const intptr_t kNumInputs = 1; 962 const intptr_t kNumInputs = 1;
943 const intptr_t kNumTemps = 0; 963 const intptr_t kNumTemps = 0;
944 LocationSummary* summary = 964 LocationSummary* summary = new(isolate) LocationSummary(
945 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 965 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
946 summary->set_in(0, Location::RegisterLocation(A0)); 966 summary->set_in(0, Location::RegisterLocation(A0));
947 summary->set_out(0, Location::RegisterLocation(V0)); 967 summary->set_out(0, Location::RegisterLocation(V0));
948 return summary; 968 return summary;
949 } 969 }
950 970
951 971
952 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 972 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
953 Register array = locs()->in(0).reg(); 973 Register array = locs()->in(0).reg();
954 __ Push(array); 974 __ Push(array);
955 const int kNumberOfArguments = 1; 975 const int kNumberOfArguments = 1;
956 const Array& kNoArgumentNames = Object::null_array(); 976 const Array& kNoArgumentNames = Object::null_array();
957 compiler->GenerateStaticCall(deopt_id(), 977 compiler->GenerateStaticCall(deopt_id(),
958 token_pos(), 978 token_pos(),
959 CallFunction(), 979 CallFunction(),
960 kNumberOfArguments, 980 kNumberOfArguments,
961 kNoArgumentNames, 981 kNoArgumentNames,
962 locs()); 982 locs());
963 ASSERT(locs()->out(0).reg() == V0); 983 ASSERT(locs()->out(0).reg() == V0);
964 } 984 }
965 985
966 986
967 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(bool opt) const { 987 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate,
988 bool opt) const {
968 const intptr_t kNumInputs = 1; 989 const intptr_t kNumInputs = 1;
969 return LocationSummary::Make(kNumInputs, 990 return LocationSummary::Make(kNumInputs,
970 Location::RequiresRegister(), 991 Location::RequiresRegister(),
971 LocationSummary::kNoCall); 992 LocationSummary::kNoCall);
972 } 993 }
973 994
974 995
975 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 996 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
976 Register object = locs()->in(0).reg(); 997 Register object = locs()->in(0).reg();
977 Register result = locs()->out(0).reg(); 998 Register result = locs()->out(0).reg();
978 __ LoadFromOffset(result, object, offset() - kHeapObjectTag); 999 __ LoadFromOffset(result, object, offset() - kHeapObjectTag);
979 } 1000 }
980 1001
981 1002
982 LocationSummary* LoadClassIdInstr::MakeLocationSummary(bool opt) const { 1003 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate,
1004 bool opt) const {
983 const intptr_t kNumInputs = 1; 1005 const intptr_t kNumInputs = 1;
984 return LocationSummary::Make(kNumInputs, 1006 return LocationSummary::Make(kNumInputs,
985 Location::RequiresRegister(), 1007 Location::RequiresRegister(),
986 LocationSummary::kNoCall); 1008 LocationSummary::kNoCall);
987 } 1009 }
988 1010
989 1011
990 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1012 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
991 Register object = locs()->in(0).reg(); 1013 Register object = locs()->in(0).reg();
992 Register result = locs()->out(0).reg(); 1014 Register result = locs()->out(0).reg();
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 return kUnboxedInt32x4; 1090 return kUnboxedInt32x4;
1069 case kTypedDataFloat32x4ArrayCid: 1091 case kTypedDataFloat32x4ArrayCid:
1070 return kUnboxedFloat32x4; 1092 return kUnboxedFloat32x4;
1071 default: 1093 default:
1072 UNIMPLEMENTED(); 1094 UNIMPLEMENTED();
1073 return kTagged; 1095 return kTagged;
1074 } 1096 }
1075 } 1097 }
1076 1098
1077 1099
1078 LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const { 1100 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Isolate* isolate,
1101 bool opt) const {
1079 const intptr_t kNumInputs = 2; 1102 const intptr_t kNumInputs = 2;
1080 const intptr_t kNumTemps = 0; 1103 const intptr_t kNumTemps = 0;
1081 LocationSummary* locs = 1104 LocationSummary* locs = new(isolate) LocationSummary(
1082 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 1105 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1083 locs->set_in(0, Location::RequiresRegister()); 1106 locs->set_in(0, Location::RequiresRegister());
1084 // The smi index is either untagged (element size == 1), or it is left smi 1107 // The smi index is either untagged (element size == 1), or it is left smi
1085 // tagged (for all element sizes > 1). 1108 // tagged (for all element sizes > 1).
1086 // TODO(regis): Revisit and see if the index can be immediate. 1109 // TODO(regis): Revisit and see if the index can be immediate.
1087 locs->set_in(1, Location::WritableRegister()); 1110 locs->set_in(1, Location::WritableRegister());
1088 if ((representation() == kUnboxedDouble) || 1111 if ((representation() == kUnboxedDouble) ||
1089 (representation() == kUnboxedFloat32x4) || 1112 (representation() == kUnboxedFloat32x4) ||
1090 (representation() == kUnboxedInt32x4)) { 1113 (representation() == kUnboxedInt32x4)) {
1091 locs->set_out(0, Location::RequiresFpuRegister()); 1114 locs->set_out(0, Location::RequiresFpuRegister());
1092 } else { 1115 } else {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 return kUnboxedFloat32x4; 1275 return kUnboxedFloat32x4;
1253 case kTypedDataInt32x4ArrayCid: 1276 case kTypedDataInt32x4ArrayCid:
1254 return kUnboxedInt32x4; 1277 return kUnboxedInt32x4;
1255 default: 1278 default:
1256 UNIMPLEMENTED(); 1279 UNIMPLEMENTED();
1257 return kTagged; 1280 return kTagged;
1258 } 1281 }
1259 } 1282 }
1260 1283
1261 1284
1262 LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const { 1285 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Isolate* isolate,
1286 bool opt) const {
1263 const intptr_t kNumInputs = 3; 1287 const intptr_t kNumInputs = 3;
1264 const intptr_t kNumTemps = 0; 1288 const intptr_t kNumTemps = 0;
1265 LocationSummary* locs = 1289 LocationSummary* locs = new(isolate) LocationSummary(
1266 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 1290 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1267 locs->set_in(0, Location::RequiresRegister()); 1291 locs->set_in(0, Location::RequiresRegister());
1268 // The smi index is either untagged (element size == 1), or it is left smi 1292 // The smi index is either untagged (element size == 1), or it is left smi
1269 // tagged (for all element sizes > 1). 1293 // tagged (for all element sizes > 1).
1270 // TODO(regis): Revisit and see if the index can be immediate. 1294 // TODO(regis): Revisit and see if the index can be immediate.
1271 locs->set_in(1, Location::WritableRegister()); 1295 locs->set_in(1, Location::WritableRegister());
1272 switch (class_id()) { 1296 switch (class_id()) {
1273 case kArrayCid: 1297 case kArrayCid:
1274 locs->set_in(2, ShouldEmitStoreBarrier() 1298 locs->set_in(2, ShouldEmitStoreBarrier()
1275 ? Location::WritableRegister() 1299 ? Location::WritableRegister()
1276 : Location::RegisterOrConstant(value())); 1300 : Location::RegisterOrConstant(value()));
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 case kTypedDataInt32x4ArrayCid: 1459 case kTypedDataInt32x4ArrayCid:
1436 case kTypedDataFloat32x4ArrayCid: 1460 case kTypedDataFloat32x4ArrayCid:
1437 UNIMPLEMENTED(); 1461 UNIMPLEMENTED();
1438 break; 1462 break;
1439 default: 1463 default:
1440 UNREACHABLE(); 1464 UNREACHABLE();
1441 } 1465 }
1442 } 1466 }
1443 1467
1444 1468
1445 LocationSummary* GuardFieldInstr::MakeLocationSummary(bool opt) const { 1469 LocationSummary* GuardFieldInstr::MakeLocationSummary(Isolate* isolate,
1470 bool opt) const {
1446 const intptr_t kNumInputs = 1; 1471 const intptr_t kNumInputs = 1;
1447 LocationSummary* summary = 1472 LocationSummary* summary = new(isolate) LocationSummary(
1448 new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall); 1473 isolate, kNumInputs, 0, LocationSummary::kNoCall);
1449 summary->set_in(0, Location::RequiresRegister()); 1474 summary->set_in(0, Location::RequiresRegister());
1450 const bool field_has_length = field().needs_length_check(); 1475 const bool field_has_length = field().needs_length_check();
1451 const bool need_value_temp_reg = 1476 const bool need_value_temp_reg =
1452 (field_has_length || ((value()->Type()->ToCid() == kDynamicCid) && 1477 (field_has_length || ((value()->Type()->ToCid() == kDynamicCid) &&
1453 (field().guarded_cid() != kSmiCid))); 1478 (field().guarded_cid() != kSmiCid)));
1454 if (need_value_temp_reg) { 1479 if (need_value_temp_reg) {
1455 summary->AddTemp(Location::RequiresRegister()); 1480 summary->AddTemp(Location::RequiresRegister());
1456 } 1481 }
1457 const bool need_field_temp_reg = 1482 const bool need_field_temp_reg =
1458 field_has_length || (field().guarded_cid() == kIllegalCid); 1483 field_has_length || (field().guarded_cid() == kIllegalCid);
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 1821
1797 __ b(exit_label()); 1822 __ b(exit_label());
1798 } 1823 }
1799 1824
1800 private: 1825 private:
1801 StoreInstanceFieldInstr* instruction_; 1826 StoreInstanceFieldInstr* instruction_;
1802 const Class& cls_; 1827 const Class& cls_;
1803 }; 1828 };
1804 1829
1805 1830
1806 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(bool opt) const { 1831 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Isolate* isolate,
1832 bool opt) const {
1807 const intptr_t kNumInputs = 2; 1833 const intptr_t kNumInputs = 2;
1808 const intptr_t kNumTemps = 0; 1834 const intptr_t kNumTemps = 0;
1809 LocationSummary* summary = 1835 LocationSummary* summary = new(isolate) LocationSummary(
1810 new LocationSummary(kNumInputs, kNumTemps, 1836 isolate, kNumInputs, kNumTemps,
1811 !field().IsNull() && 1837 !field().IsNull() &&
1812 ((field().guarded_cid() == kIllegalCid) || is_initialization_) 1838 ((field().guarded_cid() == kIllegalCid) || is_initialization_)
1813 ? LocationSummary::kCallOnSlowPath 1839 ? LocationSummary::kCallOnSlowPath
1814 : LocationSummary::kNoCall); 1840 : LocationSummary::kNoCall);
1815 1841
1816 summary->set_in(0, Location::RequiresRegister()); 1842 summary->set_in(0, Location::RequiresRegister());
1817 if (IsUnboxedStore() && opt) { 1843 if (IsUnboxedStore() && opt) {
1818 summary->set_in(1, Location::RequiresFpuRegister()); 1844 summary->set_in(1, Location::RequiresFpuRegister());
1819 summary->AddTemp(Location::RequiresRegister()); 1845 summary->AddTemp(Location::RequiresRegister());
1820 summary->AddTemp(Location::RequiresRegister()); 1846 summary->AddTemp(Location::RequiresRegister());
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 } else { 1986 } else {
1961 Register value_reg = locs()->in(1).reg(); 1987 Register value_reg = locs()->in(1).reg();
1962 __ StoreIntoObjectNoBarrier(instance_reg, 1988 __ StoreIntoObjectNoBarrier(instance_reg,
1963 FieldAddress(instance_reg, offset_in_bytes_), value_reg); 1989 FieldAddress(instance_reg, offset_in_bytes_), value_reg);
1964 } 1990 }
1965 } 1991 }
1966 __ Bind(&skip_store); 1992 __ Bind(&skip_store);
1967 } 1993 }
1968 1994
1969 1995
1970 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(bool opt) const { 1996 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Isolate* isolate,
1997 bool opt) const {
1971 const intptr_t kNumInputs = 1; 1998 const intptr_t kNumInputs = 1;
1972 const intptr_t kNumTemps = 0; 1999 const intptr_t kNumTemps = 0;
1973 LocationSummary* summary = 2000 LocationSummary* summary = new(isolate) LocationSummary(
1974 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2001 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1975 summary->set_in(0, Location::RequiresRegister()); 2002 summary->set_in(0, Location::RequiresRegister());
1976 summary->set_out(0, Location::RequiresRegister()); 2003 summary->set_out(0, Location::RequiresRegister());
1977 return summary; 2004 return summary;
1978 } 2005 }
1979 2006
1980 2007
1981 // When the parser is building an implicit static getter for optimization, 2008 // When the parser is building an implicit static getter for optimization,
1982 // it can generate a function body where deoptimization ids do not line up 2009 // it can generate a function body where deoptimization ids do not line up
1983 // with the unoptimized code. 2010 // with the unoptimized code.
1984 // 2011 //
1985 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. 2012 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
1986 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2013 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1987 __ TraceSimMsg("LoadStaticFieldInstr"); 2014 __ TraceSimMsg("LoadStaticFieldInstr");
1988 Register field = locs()->in(0).reg(); 2015 Register field = locs()->in(0).reg();
1989 Register result = locs()->out(0).reg(); 2016 Register result = locs()->out(0).reg();
1990 __ lw(result, FieldAddress(field, Field::value_offset())); 2017 __ lw(result, FieldAddress(field, Field::value_offset()));
1991 } 2018 }
1992 2019
1993 2020
1994 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(bool opt) const { 2021 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Isolate* isolate,
1995 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall); 2022 bool opt) const {
2023 LocationSummary* locs = new(isolate) LocationSummary(
2024 isolate, 1, 1, LocationSummary::kNoCall);
1996 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() 2025 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
1997 : Location::RequiresRegister()); 2026 : Location::RequiresRegister());
1998 locs->set_temp(0, Location::RequiresRegister()); 2027 locs->set_temp(0, Location::RequiresRegister());
1999 return locs; 2028 return locs;
2000 } 2029 }
2001 2030
2002 2031
2003 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2032 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2004 __ TraceSimMsg("StoreStaticFieldInstr"); 2033 __ TraceSimMsg("StoreStaticFieldInstr");
2005 Register value = locs()->in(0).reg(); 2034 Register value = locs()->in(0).reg();
2006 Register temp = locs()->temp(0).reg(); 2035 Register temp = locs()->temp(0).reg();
2007 2036
2008 __ LoadObject(temp, field()); 2037 __ LoadObject(temp, field());
2009 if (this->value()->NeedsStoreBuffer()) { 2038 if (this->value()->NeedsStoreBuffer()) {
2010 __ StoreIntoObject(temp, 2039 __ StoreIntoObject(temp,
2011 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); 2040 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi());
2012 } else { 2041 } else {
2013 __ StoreIntoObjectNoBarrier( 2042 __ StoreIntoObjectNoBarrier(
2014 temp, FieldAddress(temp, Field::value_offset()), value); 2043 temp, FieldAddress(temp, Field::value_offset()), value);
2015 } 2044 }
2016 } 2045 }
2017 2046
2018 2047
2019 LocationSummary* InstanceOfInstr::MakeLocationSummary(bool opt) const { 2048 LocationSummary* InstanceOfInstr::MakeLocationSummary(Isolate* isolate,
2049 bool opt) const {
2020 const intptr_t kNumInputs = 3; 2050 const intptr_t kNumInputs = 3;
2021 const intptr_t kNumTemps = 0; 2051 const intptr_t kNumTemps = 0;
2022 LocationSummary* summary = 2052 LocationSummary* summary = new(isolate) LocationSummary(
2023 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 2053 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2024 summary->set_in(0, Location::RegisterLocation(A0)); 2054 summary->set_in(0, Location::RegisterLocation(A0));
2025 summary->set_in(1, Location::RegisterLocation(A2)); 2055 summary->set_in(1, Location::RegisterLocation(A2));
2026 summary->set_in(2, Location::RegisterLocation(A1)); 2056 summary->set_in(2, Location::RegisterLocation(A1));
2027 summary->set_out(0, Location::RegisterLocation(V0)); 2057 summary->set_out(0, Location::RegisterLocation(V0));
2028 return summary; 2058 return summary;
2029 } 2059 }
2030 2060
2031 2061
2032 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2062 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2033 ASSERT(locs()->in(0).reg() == A0); // Value. 2063 ASSERT(locs()->in(0).reg() == A0); // Value.
2034 ASSERT(locs()->in(1).reg() == A2); // Instantiator. 2064 ASSERT(locs()->in(1).reg() == A2); // Instantiator.
2035 ASSERT(locs()->in(2).reg() == A1); // Instantiator type arguments. 2065 ASSERT(locs()->in(2).reg() == A1); // Instantiator type arguments.
2036 2066
2037 __ Comment("InstanceOfInstr"); 2067 __ Comment("InstanceOfInstr");
2038 compiler->GenerateInstanceOf(token_pos(), 2068 compiler->GenerateInstanceOf(token_pos(),
2039 deopt_id(), 2069 deopt_id(),
2040 type(), 2070 type(),
2041 negate_result(), 2071 negate_result(),
2042 locs()); 2072 locs());
2043 ASSERT(locs()->out(0).reg() == V0); 2073 ASSERT(locs()->out(0).reg() == V0);
2044 } 2074 }
2045 2075
2046 2076
2047 LocationSummary* CreateArrayInstr::MakeLocationSummary(bool opt) const { 2077 LocationSummary* CreateArrayInstr::MakeLocationSummary(Isolate* isolate,
2078 bool opt) const {
2048 const intptr_t kNumInputs = 2; 2079 const intptr_t kNumInputs = 2;
2049 const intptr_t kNumTemps = 0; 2080 const intptr_t kNumTemps = 0;
2050 LocationSummary* locs = 2081 LocationSummary* locs = new(isolate) LocationSummary(
2051 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 2082 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2052 locs->set_in(0, Location::RegisterLocation(A0)); 2083 locs->set_in(0, Location::RegisterLocation(A0));
2053 locs->set_in(1, Location::RegisterLocation(A1)); 2084 locs->set_in(1, Location::RegisterLocation(A1));
2054 locs->set_out(0, Location::RegisterLocation(V0)); 2085 locs->set_out(0, Location::RegisterLocation(V0));
2055 return locs; 2086 return locs;
2056 } 2087 }
2057 2088
2058 2089
2059 // Inlines array allocation for known constant values. 2090 // Inlines array allocation for known constant values.
2060 static void InlineArrayAllocation(FlowGraphCompiler* compiler, 2091 static void InlineArrayAllocation(FlowGraphCompiler* compiler,
2061 intptr_t num_elements, 2092 intptr_t num_elements,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 compiler->RestoreLiveRegisters(locs); 2228 compiler->RestoreLiveRegisters(locs);
2198 2229
2199 __ b(exit_label()); 2230 __ b(exit_label());
2200 } 2231 }
2201 2232
2202 private: 2233 private:
2203 Instruction* instruction_; 2234 Instruction* instruction_;
2204 }; 2235 };
2205 2236
2206 2237
2207 LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const { 2238 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate,
2239 bool opt) const {
2208 const intptr_t kNumInputs = 1; 2240 const intptr_t kNumInputs = 1;
2209 const intptr_t kNumTemps = 0; 2241 const intptr_t kNumTemps = 0;
2210 LocationSummary* locs = 2242 LocationSummary* locs = new(isolate) LocationSummary(
2211 new LocationSummary( 2243 isolate, kNumInputs, kNumTemps,
2212 kNumInputs, kNumTemps,
2213 (opt && !IsPotentialUnboxedLoad()) 2244 (opt && !IsPotentialUnboxedLoad())
2214 ? LocationSummary::kNoCall 2245 ? LocationSummary::kNoCall
2215 : LocationSummary::kCallOnSlowPath); 2246 : LocationSummary::kCallOnSlowPath);
2216 2247
2217 locs->set_in(0, Location::RequiresRegister()); 2248 locs->set_in(0, Location::RequiresRegister());
2218 2249
2219 if (IsUnboxedLoad() && opt) { 2250 if (IsUnboxedLoad() && opt) {
2220 locs->AddTemp(Location::RequiresRegister()); 2251 locs->AddTemp(Location::RequiresRegister());
2221 } else if (IsPotentialUnboxedLoad()) { 2252 } else if (IsPotentialUnboxedLoad()) {
2222 locs->AddTemp(opt ? Location::RequiresFpuRegister() 2253 locs->AddTemp(opt ? Location::RequiresFpuRegister()
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
2292 __ b(&done); 2323 __ b(&done);
2293 } 2324 }
2294 2325
2295 __ Bind(&load_pointer); 2326 __ Bind(&load_pointer);
2296 } 2327 }
2297 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag)); 2328 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag));
2298 __ Bind(&done); 2329 __ Bind(&done);
2299 } 2330 }
2300 2331
2301 2332
2302 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(bool opt) const { 2333 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Isolate* isolate,
2334 bool opt) const {
2303 const intptr_t kNumInputs = 1; 2335 const intptr_t kNumInputs = 1;
2304 const intptr_t kNumTemps = 0; 2336 const intptr_t kNumTemps = 0;
2305 LocationSummary* locs = 2337 LocationSummary* locs = new(isolate) LocationSummary(
2306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 2338 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2307 locs->set_in(0, Location::RegisterLocation(T0)); 2339 locs->set_in(0, Location::RegisterLocation(T0));
2308 locs->set_out(0, Location::RegisterLocation(T0)); 2340 locs->set_out(0, Location::RegisterLocation(T0));
2309 return locs; 2341 return locs;
2310 } 2342 }
2311 2343
2312 2344
2313 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2345 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2314 __ TraceSimMsg("InstantiateTypeInstr"); 2346 __ TraceSimMsg("InstantiateTypeInstr");
2315 Register instantiator_reg = locs()->in(0).reg(); 2347 Register instantiator_reg = locs()->in(0).reg();
2316 Register result_reg = locs()->out(0).reg(); 2348 Register result_reg = locs()->out(0).reg();
(...skipping 15 matching lines...) Expand all
2332 locs()); 2364 locs());
2333 // Pop instantiated type. 2365 // Pop instantiated type.
2334 __ lw(result_reg, Address(SP, 2 * kWordSize)); 2366 __ lw(result_reg, Address(SP, 2 * kWordSize));
2335 // Drop instantiator and uninstantiated type. 2367 // Drop instantiator and uninstantiated type.
2336 __ addiu(SP, SP, Immediate(3 * kWordSize)); 2368 __ addiu(SP, SP, Immediate(3 * kWordSize));
2337 ASSERT(instantiator_reg == result_reg); 2369 ASSERT(instantiator_reg == result_reg);
2338 } 2370 }
2339 2371
2340 2372
2341 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( 2373 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
2342 bool opt) const { 2374 Isolate* isolate, bool opt) const {
2343 const intptr_t kNumInputs = 1; 2375 const intptr_t kNumInputs = 1;
2344 const intptr_t kNumTemps = 0; 2376 const intptr_t kNumTemps = 0;
2345 LocationSummary* locs = 2377 LocationSummary* locs = new(isolate) LocationSummary(
2346 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 2378 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2347 locs->set_in(0, Location::RegisterLocation(T0)); 2379 locs->set_in(0, Location::RegisterLocation(T0));
2348 locs->set_out(0, Location::RegisterLocation(T0)); 2380 locs->set_out(0, Location::RegisterLocation(T0));
2349 return locs; 2381 return locs;
2350 } 2382 }
2351 2383
2352 2384
2353 void InstantiateTypeArgumentsInstr::EmitNativeCode( 2385 void InstantiateTypeArgumentsInstr::EmitNativeCode(
2354 FlowGraphCompiler* compiler) { 2386 FlowGraphCompiler* compiler) {
2355 __ TraceSimMsg("InstantiateTypeArgumentsInstr"); 2387 __ TraceSimMsg("InstantiateTypeArgumentsInstr");
2356 Register instantiator_reg = locs()->in(0).reg(); 2388 Register instantiator_reg = locs()->in(0).reg();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 2, 2437 2,
2406 locs()); 2438 locs());
2407 // Pop instantiated type arguments. 2439 // Pop instantiated type arguments.
2408 __ lw(result_reg, Address(SP, 2 * kWordSize)); 2440 __ lw(result_reg, Address(SP, 2 * kWordSize));
2409 // Drop instantiator and uninstantiated type arguments. 2441 // Drop instantiator and uninstantiated type arguments.
2410 __ addiu(SP, SP, Immediate(3 * kWordSize)); 2442 __ addiu(SP, SP, Immediate(3 * kWordSize));
2411 __ Bind(&type_arguments_instantiated); 2443 __ Bind(&type_arguments_instantiated);
2412 } 2444 }
2413 2445
2414 2446
2415 LocationSummary* AllocateContextInstr::MakeLocationSummary(bool opt) const { 2447 LocationSummary* AllocateContextInstr::MakeLocationSummary(Isolate* isolate,
2448 bool opt) const {
2416 const intptr_t kNumInputs = 0; 2449 const intptr_t kNumInputs = 0;
2417 const intptr_t kNumTemps = 1; 2450 const intptr_t kNumTemps = 1;
2418 LocationSummary* locs = 2451 LocationSummary* locs = new(isolate) LocationSummary(
2419 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 2452 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2420 locs->set_temp(0, Location::RegisterLocation(T1)); 2453 locs->set_temp(0, Location::RegisterLocation(T1));
2421 locs->set_out(0, Location::RegisterLocation(V0)); 2454 locs->set_out(0, Location::RegisterLocation(V0));
2422 return locs; 2455 return locs;
2423 } 2456 }
2424 2457
2425 2458
2426 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2459 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2427 Register temp = T1; 2460 Register temp = T1;
2428 ASSERT(locs()->temp(0).reg() == temp); 2461 ASSERT(locs()->temp(0).reg() == temp);
2429 ASSERT(locs()->out(0).reg() == V0); 2462 ASSERT(locs()->out(0).reg() == V0);
2430 2463
2431 __ TraceSimMsg("AllocateContextInstr"); 2464 __ TraceSimMsg("AllocateContextInstr");
2432 __ LoadImmediate(temp, num_context_variables()); 2465 __ LoadImmediate(temp, num_context_variables());
2433 const ExternalLabel label("alloc_context", 2466 const ExternalLabel label("alloc_context",
2434 StubCode::AllocateContextEntryPoint()); 2467 StubCode::AllocateContextEntryPoint());
2435 compiler->GenerateCall(token_pos(), 2468 compiler->GenerateCall(token_pos(),
2436 &label, 2469 &label,
2437 PcDescriptors::kOther, 2470 PcDescriptors::kOther,
2438 locs()); 2471 locs());
2439 } 2472 }
2440 2473
2441 2474
2442 LocationSummary* CloneContextInstr::MakeLocationSummary(bool opt) const { 2475 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate,
2476 bool opt) const {
2443 const intptr_t kNumInputs = 1; 2477 const intptr_t kNumInputs = 1;
2444 const intptr_t kNumTemps = 0; 2478 const intptr_t kNumTemps = 0;
2445 LocationSummary* locs = 2479 LocationSummary* locs = new(isolate) LocationSummary(
2446 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 2480 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2447 locs->set_in(0, Location::RegisterLocation(T0)); 2481 locs->set_in(0, Location::RegisterLocation(T0));
2448 locs->set_out(0, Location::RegisterLocation(T0)); 2482 locs->set_out(0, Location::RegisterLocation(T0));
2449 return locs; 2483 return locs;
2450 } 2484 }
2451 2485
2452 2486
2453 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2487 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2454 Register context_value = locs()->in(0).reg(); 2488 Register context_value = locs()->in(0).reg();
2455 Register result = locs()->out(0).reg(); 2489 Register result = locs()->out(0).reg();
2456 2490
2457 __ TraceSimMsg("CloneContextInstr"); 2491 __ TraceSimMsg("CloneContextInstr");
2458 2492
2459 __ addiu(SP, SP, Immediate(-2 * kWordSize)); 2493 __ addiu(SP, SP, Immediate(-2 * kWordSize));
2460 __ LoadObject(TMP, Object::ZoneHandle()); // Make room for the result. 2494 __ LoadObject(TMP, Object::ZoneHandle()); // Make room for the result.
2461 __ sw(TMP, Address(SP, 1 * kWordSize)); 2495 __ sw(TMP, Address(SP, 1 * kWordSize));
2462 __ sw(context_value, Address(SP, 0 * kWordSize)); 2496 __ sw(context_value, Address(SP, 0 * kWordSize));
2463 2497
2464 compiler->GenerateRuntimeCall(token_pos(), 2498 compiler->GenerateRuntimeCall(token_pos(),
2465 deopt_id(), 2499 deopt_id(),
2466 kCloneContextRuntimeEntry, 2500 kCloneContextRuntimeEntry,
2467 1, 2501 1,
2468 locs()); 2502 locs());
2469 __ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context). 2503 __ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context).
2470 __ addiu(SP, SP, Immediate(2 * kWordSize)); 2504 __ addiu(SP, SP, Immediate(2 * kWordSize));
2471 } 2505 }
2472 2506
2473 2507
2474 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(bool opt) const { 2508 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Isolate* isolate,
2509 bool opt) const {
2475 UNREACHABLE(); 2510 UNREACHABLE();
2476 return NULL; 2511 return NULL;
2477 } 2512 }
2478 2513
2479 2514
2480 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2515 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2481 __ Bind(compiler->GetJumpLabel(this)); 2516 __ Bind(compiler->GetJumpLabel(this));
2482 compiler->AddExceptionHandler(catch_try_index(), 2517 compiler->AddExceptionHandler(catch_try_index(),
2483 try_index(), 2518 try_index(),
2484 compiler->assembler()->CodeSize(), 2519 compiler->assembler()->CodeSize(),
(...skipping 19 matching lines...) Expand all
2504 2539
2505 // Restore stack and initialize the two exception variables: 2540 // Restore stack and initialize the two exception variables:
2506 // exception and stack trace variables. 2541 // exception and stack trace variables.
2507 __ sw(kExceptionObjectReg, 2542 __ sw(kExceptionObjectReg,
2508 Address(FP, exception_var().index() * kWordSize)); 2543 Address(FP, exception_var().index() * kWordSize));
2509 __ sw(kStackTraceObjectReg, 2544 __ sw(kStackTraceObjectReg,
2510 Address(FP, stacktrace_var().index() * kWordSize)); 2545 Address(FP, stacktrace_var().index() * kWordSize));
2511 } 2546 }
2512 2547
2513 2548
2514 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(bool opt) const { 2549 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Isolate* isolate,
2550 bool opt) const {
2515 const intptr_t kNumInputs = 0; 2551 const intptr_t kNumInputs = 0;
2516 const intptr_t kNumTemps = 1; 2552 const intptr_t kNumTemps = 1;
2517 LocationSummary* summary = 2553 LocationSummary* summary = new(isolate) LocationSummary(
2518 new LocationSummary(kNumInputs, 2554 isolate, kNumInputs,
2519 kNumTemps, 2555 kNumTemps,
2520 LocationSummary::kCallOnSlowPath); 2556 LocationSummary::kCallOnSlowPath);
2521 summary->set_temp(0, Location::RequiresRegister()); 2557 summary->set_temp(0, Location::RequiresRegister());
2522 return summary; 2558 return summary;
2523 } 2559 }
2524 2560
2525 2561
2526 class CheckStackOverflowSlowPath : public SlowPathCode { 2562 class CheckStackOverflowSlowPath : public SlowPathCode {
2527 public: 2563 public:
2528 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) 2564 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
2711 // Overflow test (preserve left, right, and temp); 2747 // Overflow test (preserve left, right, and temp);
2712 __ sllv(CMPRES1, left, temp); 2748 __ sllv(CMPRES1, left, temp);
2713 __ srav(CMPRES1, CMPRES1, temp); 2749 __ srav(CMPRES1, CMPRES1, temp);
2714 __ bne(CMPRES1, left, deopt); // Overflow. 2750 __ bne(CMPRES1, left, deopt); // Overflow.
2715 // Shift for result now we know there is no overflow. 2751 // Shift for result now we know there is no overflow.
2716 __ sllv(result, left, temp); 2752 __ sllv(result, left, temp);
2717 } 2753 }
2718 } 2754 }
2719 2755
2720 2756
2721 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(bool opt) const { 2757 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Isolate* isolate,
2758 bool opt) const {
2722 const intptr_t kNumInputs = 2; 2759 const intptr_t kNumInputs = 2;
2723 const intptr_t kNumTemps = op_kind() == Token::kADD ? 1 : 0; 2760 const intptr_t kNumTemps = op_kind() == Token::kADD ? 1 : 0;
2724 LocationSummary* summary = 2761 LocationSummary* summary = new(isolate) LocationSummary(
2725 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2762 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
2726 if (op_kind() == Token::kTRUNCDIV) { 2763 if (op_kind() == Token::kTRUNCDIV) {
2727 summary->set_in(0, Location::RequiresRegister()); 2764 summary->set_in(0, Location::RequiresRegister());
2728 if (RightIsPowerOfTwoConstant()) { 2765 if (RightIsPowerOfTwoConstant()) {
2729 ConstantInstr* right_constant = right()->definition()->AsConstant(); 2766 ConstantInstr* right_constant = right()->definition()->AsConstant();
2730 summary->set_in(1, Location::Constant(right_constant->value())); 2767 summary->set_in(1, Location::Constant(right_constant->value()));
2731 } else { 2768 } else {
2732 summary->set_in(1, Location::RequiresRegister()); 2769 summary->set_in(1, Location::RequiresRegister());
2733 } 2770 }
2734 summary->AddTemp(Location::RequiresRegister()); 2771 summary->AddTemp(Location::RequiresRegister());
2735 summary->set_out(0, Location::RequiresRegister()); 2772 summary->set_out(0, Location::RequiresRegister());
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
3059 UNREACHABLE(); 3096 UNREACHABLE();
3060 break; 3097 break;
3061 } 3098 }
3062 default: 3099 default:
3063 UNREACHABLE(); 3100 UNREACHABLE();
3064 break; 3101 break;
3065 } 3102 }
3066 } 3103 }
3067 3104
3068 3105
3069 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(bool opt) const { 3106 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Isolate* isolate,
3107 bool opt) const {
3070 intptr_t left_cid = left()->Type()->ToCid(); 3108 intptr_t left_cid = left()->Type()->ToCid();
3071 intptr_t right_cid = right()->Type()->ToCid(); 3109 intptr_t right_cid = right()->Type()->ToCid();
3072 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); 3110 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
3073 const intptr_t kNumInputs = 2; 3111 const intptr_t kNumInputs = 2;
3074 const intptr_t kNumTemps = 0; 3112 const intptr_t kNumTemps = 0;
3075 LocationSummary* summary = 3113 LocationSummary* summary = new(isolate) LocationSummary(
3076 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3114 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3077 summary->set_in(0, Location::RequiresRegister()); 3115 summary->set_in(0, Location::RequiresRegister());
3078 summary->set_in(1, Location::RequiresRegister()); 3116 summary->set_in(1, Location::RequiresRegister());
3079 return summary; 3117 return summary;
3080 } 3118 }
3081 3119
3082 3120
3083 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3121 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3084 Label* deopt = compiler->AddDeoptStub(deopt_id(), 3122 Label* deopt = compiler->AddDeoptStub(deopt_id(),
3085 ICData::kDeoptBinaryDoubleOp); 3123 ICData::kDeoptBinaryDoubleOp);
3086 intptr_t left_cid = left()->Type()->ToCid(); 3124 intptr_t left_cid = left()->Type()->ToCid();
3087 intptr_t right_cid = right()->Type()->ToCid(); 3125 intptr_t right_cid = right()->Type()->ToCid();
3088 Register left = locs()->in(0).reg(); 3126 Register left = locs()->in(0).reg();
3089 Register right = locs()->in(1).reg(); 3127 Register right = locs()->in(1).reg();
3090 if (this->left()->definition() == this->right()->definition()) { 3128 if (this->left()->definition() == this->right()->definition()) {
3091 __ andi(CMPRES1, left, Immediate(kSmiTagMask)); 3129 __ andi(CMPRES1, left, Immediate(kSmiTagMask));
3092 } else if (left_cid == kSmiCid) { 3130 } else if (left_cid == kSmiCid) {
3093 __ andi(CMPRES1, right, Immediate(kSmiTagMask)); 3131 __ andi(CMPRES1, right, Immediate(kSmiTagMask));
3094 } else if (right_cid == kSmiCid) { 3132 } else if (right_cid == kSmiCid) {
3095 __ andi(CMPRES1, left, Immediate(kSmiTagMask)); 3133 __ andi(CMPRES1, left, Immediate(kSmiTagMask));
3096 } else { 3134 } else {
3097 __ or_(TMP, left, right); 3135 __ or_(TMP, left, right);
3098 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); 3136 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask));
3099 } 3137 }
3100 __ beq(CMPRES1, ZR, deopt); 3138 __ beq(CMPRES1, ZR, deopt);
3101 } 3139 }
3102 3140
3103 3141
3104 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { 3142 LocationSummary* BoxDoubleInstr::MakeLocationSummary(Isolate* isolate,
3143 bool opt) const {
3105 const intptr_t kNumInputs = 1; 3144 const intptr_t kNumInputs = 1;
3106 const intptr_t kNumTemps = 1; 3145 const intptr_t kNumTemps = 1;
3107 LocationSummary* summary = 3146 LocationSummary* summary = new(isolate) LocationSummary(
3108 new LocationSummary(kNumInputs, 3147 isolate, kNumInputs,
3109 kNumTemps, 3148 kNumTemps,
3110 LocationSummary::kCallOnSlowPath); 3149 LocationSummary::kCallOnSlowPath);
3111 summary->set_in(0, Location::RequiresFpuRegister()); 3150 summary->set_in(0, Location::RequiresFpuRegister());
3112 summary->set_temp(0, Location::RequiresRegister()); 3151 summary->set_temp(0, Location::RequiresRegister());
3113 summary->set_out(0, Location::RequiresRegister()); 3152 summary->set_out(0, Location::RequiresRegister());
3114 return summary; 3153 return summary;
3115 } 3154 }
3116 3155
3117 3156
3118 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3157 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3119 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); 3158 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
3120 compiler->AddSlowPathCode(slow_path); 3159 compiler->AddSlowPathCode(slow_path);
3121 3160
3122 Register out_reg = locs()->out(0).reg(); 3161 Register out_reg = locs()->out(0).reg();
3123 DRegister value = locs()->in(0).fpu_reg(); 3162 DRegister value = locs()->in(0).fpu_reg();
3124 3163
3125 __ TryAllocate(compiler->double_class(), 3164 __ TryAllocate(compiler->double_class(),
3126 slow_path->entry_label(), 3165 slow_path->entry_label(),
3127 out_reg, 3166 out_reg,
3128 locs()->temp(0).reg()); 3167 locs()->temp(0).reg());
3129 __ Bind(slow_path->exit_label()); 3168 __ Bind(slow_path->exit_label());
3130 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); 3169 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag);
3131 } 3170 }
3132 3171
3133 3172
3134 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { 3173 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(Isolate* isolate,
3174 bool opt) const {
3135 const intptr_t kNumInputs = 1; 3175 const intptr_t kNumInputs = 1;
3136 const intptr_t value_cid = value()->Type()->ToCid(); 3176 const intptr_t value_cid = value()->Type()->ToCid();
3137 const bool needs_writable_input = (value_cid == kSmiCid); 3177 const bool needs_writable_input = (value_cid == kSmiCid);
3138 const intptr_t kNumTemps = 0; 3178 const intptr_t kNumTemps = 0;
3139 LocationSummary* summary = 3179 LocationSummary* summary = new(isolate) LocationSummary(
3140 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3180 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3141 summary->set_in(0, needs_writable_input 3181 summary->set_in(0, needs_writable_input
3142 ? Location::WritableRegister() 3182 ? Location::WritableRegister()
3143 : Location::RequiresRegister()); 3183 : Location::RequiresRegister());
3144 summary->set_out(0, Location::RequiresFpuRegister()); 3184 summary->set_out(0, Location::RequiresFpuRegister());
3145 return summary; 3185 return summary;
3146 } 3186 }
3147 3187
3148 3188
3149 void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3189 void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3150 CompileType* value_type = value()->Type(); 3190 CompileType* value_type = value()->Type();
(...skipping 30 matching lines...) Expand all
3181 // TODO(regis): Why do we preserve value here but not above? 3221 // TODO(regis): Why do we preserve value here but not above?
3182 __ sra(TMP, value, 1); 3222 __ sra(TMP, value, 1);
3183 __ mtc1(TMP, STMP1); 3223 __ mtc1(TMP, STMP1);
3184 __ cvtdw(result, STMP1); 3224 __ cvtdw(result, STMP1);
3185 __ Bind(&done); 3225 __ Bind(&done);
3186 } 3226 }
3187 } 3227 }
3188 } 3228 }
3189 3229
3190 3230
3191 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(bool opt) const { 3231 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(Isolate* isolate,
3232 bool opt) const {
3192 UNIMPLEMENTED(); 3233 UNIMPLEMENTED();
3193 return NULL; 3234 return NULL;
3194 } 3235 }
3195 3236
3196 3237
3197 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3238 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3198 UNIMPLEMENTED(); 3239 UNIMPLEMENTED();
3199 } 3240 }
3200 3241
3201 3242
3202 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(bool opt) const { 3243 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(Isolate* isolate,
3244 bool opt) const {
3203 UNIMPLEMENTED(); 3245 UNIMPLEMENTED();
3204 return NULL; 3246 return NULL;
3205 } 3247 }
3206 3248
3207 3249
3208 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3250 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3209 UNIMPLEMENTED(); 3251 UNIMPLEMENTED();
3210 } 3252 }
3211 3253
3212 3254
3213 LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(bool opt) const { 3255 LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(Isolate* isolate,
3256 bool opt) const {
3214 UNIMPLEMENTED(); 3257 UNIMPLEMENTED();
3215 return NULL; 3258 return NULL;
3216 } 3259 }
3217 3260
3218 3261
3219 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3262 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3220 UNIMPLEMENTED(); 3263 UNIMPLEMENTED();
3221 } 3264 }
3222 3265
3223 3266
3224 LocationSummary* UnboxFloat64x2Instr::MakeLocationSummary(bool opt) const { 3267 LocationSummary* UnboxFloat64x2Instr::MakeLocationSummary(Isolate* isolate,
3268 bool opt) const {
3225 UNIMPLEMENTED(); 3269 UNIMPLEMENTED();
3226 return NULL; 3270 return NULL;
3227 } 3271 }
3228 3272
3229 3273
3230 void UnboxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3274 void UnboxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3231 UNIMPLEMENTED(); 3275 UNIMPLEMENTED();
3232 } 3276 }
3233 3277
3234 3278
3235 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { 3279 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(Isolate* isolate,
3280 bool opt) const {
3236 UNIMPLEMENTED(); 3281 UNIMPLEMENTED();
3237 return NULL; 3282 return NULL;
3238 } 3283 }
3239 3284
3240 3285
3241 void BoxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3286 void BoxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3242 UNIMPLEMENTED(); 3287 UNIMPLEMENTED();
3243 } 3288 }
3244 3289
3245 3290
3246 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(bool opt) const { 3291 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(Isolate* isolate,
3292 bool opt) const {
3247 UNIMPLEMENTED(); 3293 UNIMPLEMENTED();
3248 return NULL; 3294 return NULL;
3249 } 3295 }
3250 3296
3251 3297
3252 void UnboxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3298 void UnboxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3253 UNIMPLEMENTED(); 3299 UNIMPLEMENTED();
3254 } 3300 }
3255 3301
3256 3302
3257 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(bool opt) const { 3303 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate,
3304 bool opt) const {
3258 const intptr_t kNumInputs = 2; 3305 const intptr_t kNumInputs = 2;
3259 const intptr_t kNumTemps = 0; 3306 const intptr_t kNumTemps = 0;
3260 LocationSummary* summary = 3307 LocationSummary* summary = new(isolate) LocationSummary(
3261 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3308 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3262 summary->set_in(0, Location::RequiresFpuRegister()); 3309 summary->set_in(0, Location::RequiresFpuRegister());
3263 summary->set_in(1, Location::RequiresFpuRegister()); 3310 summary->set_in(1, Location::RequiresFpuRegister());
3264 summary->set_out(0, Location::RequiresFpuRegister()); 3311 summary->set_out(0, Location::RequiresFpuRegister());
3265 return summary; 3312 return summary;
3266 } 3313 }
3267 3314
3268 3315
3269 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3316 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3270 DRegister left = locs()->in(0).fpu_reg(); 3317 DRegister left = locs()->in(0).fpu_reg();
3271 DRegister right = locs()->in(1).fpu_reg(); 3318 DRegister right = locs()->in(1).fpu_reg();
3272 DRegister result = locs()->out(0).fpu_reg(); 3319 DRegister result = locs()->out(0).fpu_reg();
3273 switch (op_kind()) { 3320 switch (op_kind()) {
3274 case Token::kADD: __ addd(result, left, right); break; 3321 case Token::kADD: __ addd(result, left, right); break;
3275 case Token::kSUB: __ subd(result, left, right); break; 3322 case Token::kSUB: __ subd(result, left, right); break;
3276 case Token::kMUL: __ muld(result, left, right); break; 3323 case Token::kMUL: __ muld(result, left, right); break;
3277 case Token::kDIV: __ divd(result, left, right); break; 3324 case Token::kDIV: __ divd(result, left, right); break;
3278 default: UNREACHABLE(); 3325 default: UNREACHABLE();
3279 } 3326 }
3280 } 3327 }
3281 3328
3282 3329
3283 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(bool opt) const { 3330 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Isolate* isolate,
3331 bool opt) const {
3284 UNIMPLEMENTED(); 3332 UNIMPLEMENTED();
3285 return NULL; 3333 return NULL;
3286 } 3334 }
3287 3335
3288 3336
3289 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3337 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3290 UNIMPLEMENTED(); 3338 UNIMPLEMENTED();
3291 } 3339 }
3292 3340
3293 3341
3294 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(bool opt) const { 3342 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Isolate* isolate,
3343 bool opt) const {
3295 UNIMPLEMENTED(); 3344 UNIMPLEMENTED();
3296 return NULL; 3345 return NULL;
3297 } 3346 }
3298 3347
3299 3348
3300 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3349 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3301 UNIMPLEMENTED(); 3350 UNIMPLEMENTED();
3302 } 3351 }
3303 3352
3304 3353
3305 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(bool opt) const { 3354 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Isolate* isolate,
3355 bool opt) const {
3306 UNIMPLEMENTED(); 3356 UNIMPLEMENTED();
3307 return NULL; 3357 return NULL;
3308 } 3358 }
3309 3359
3310 3360
3311 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3361 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3312 UNIMPLEMENTED(); 3362 UNIMPLEMENTED();
3313 } 3363 }
3314 3364
3315 3365
3316 3366
3317 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(bool opt) const { 3367 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Isolate* isolate,
3368 bool opt) const {
3318 UNIMPLEMENTED(); 3369 UNIMPLEMENTED();
3319 return NULL; 3370 return NULL;
3320 } 3371 }
3321 3372
3322 3373
3323 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3374 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3324 UNIMPLEMENTED(); 3375 UNIMPLEMENTED();
3325 } 3376 }
3326 3377
3327 3378
3328 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( 3379 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
3329 bool opt) const { 3380 Isolate* isolate, bool opt) const {
3330 UNIMPLEMENTED(); 3381 UNIMPLEMENTED();
3331 return NULL; 3382 return NULL;
3332 } 3383 }
3333 3384
3334 3385
3335 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3386 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3336 UNIMPLEMENTED(); 3387 UNIMPLEMENTED();
3337 } 3388 }
3338 3389
3339 3390
3340 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(bool opt) const { 3391 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Isolate* isolate,
3392 bool opt) const {
3341 UNIMPLEMENTED(); 3393 UNIMPLEMENTED();
3342 return NULL; 3394 return NULL;
3343 } 3395 }
3344 3396
3345 3397
3346 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3398 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3347 UNIMPLEMENTED(); 3399 UNIMPLEMENTED();
3348 } 3400 }
3349 3401
3350 3402
3351 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(bool opt) const { 3403 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Isolate* isolate,
3404 bool opt) const {
3352 UNIMPLEMENTED(); 3405 UNIMPLEMENTED();
3353 return NULL; 3406 return NULL;
3354 } 3407 }
3355 3408
3356 3409
3357 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3410 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3358 UNIMPLEMENTED(); 3411 UNIMPLEMENTED();
3359 } 3412 }
3360 3413
3361 3414
3362 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(bool opt) const { 3415 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Isolate* isolate,
3416 bool opt) const {
3363 UNIMPLEMENTED(); 3417 UNIMPLEMENTED();
3364 return NULL; 3418 return NULL;
3365 } 3419 }
3366 3420
3367 3421
3368 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3422 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3369 UNIMPLEMENTED(); 3423 UNIMPLEMENTED();
3370 } 3424 }
3371 3425
3372 3426
3373 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(bool opt) const { 3427 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(Isolate* isolate,
3428 bool opt) const {
3374 UNIMPLEMENTED(); 3429 UNIMPLEMENTED();
3375 return NULL; 3430 return NULL;
3376 } 3431 }
3377 3432
3378 3433
3379 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3434 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3380 UNIMPLEMENTED(); 3435 UNIMPLEMENTED();
3381 } 3436 }
3382 3437
3383 3438
3384 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(bool opt) const { 3439 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Isolate* isolate,
3440 bool opt) const {
3385 UNIMPLEMENTED(); 3441 UNIMPLEMENTED();
3386 return NULL; 3442 return NULL;
3387 } 3443 }
3388 3444
3389 3445
3390 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3446 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3391 UNIMPLEMENTED(); 3447 UNIMPLEMENTED();
3392 } 3448 }
3393 3449
3394 3450
3395 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(bool opt) const { 3451 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Isolate* isolate,
3452 bool opt) const {
3396 UNIMPLEMENTED(); 3453 UNIMPLEMENTED();
3397 return NULL; 3454 return NULL;
3398 } 3455 }
3399 3456
3400 3457
3401 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3458 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3402 UNIMPLEMENTED(); 3459 UNIMPLEMENTED();
3403 } 3460 }
3404 3461
3405 3462
3406 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(bool opt) const { 3463 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Isolate* isolate,
3464 bool opt) const {
3407 UNIMPLEMENTED(); 3465 UNIMPLEMENTED();
3408 return NULL; 3466 return NULL;
3409 } 3467 }
3410 3468
3411 3469
3412 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3470 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3413 UNIMPLEMENTED(); 3471 UNIMPLEMENTED();
3414 } 3472 }
3415 3473
3416 3474
3417 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(bool opt) const { 3475 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Isolate* isolate,
3476 bool opt) const {
3418 UNIMPLEMENTED(); 3477 UNIMPLEMENTED();
3419 return NULL; 3478 return NULL;
3420 } 3479 }
3421 3480
3422 3481
3423 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3482 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3424 UNIMPLEMENTED(); 3483 UNIMPLEMENTED();
3425 } 3484 }
3426 3485
3427 3486
3428 LocationSummary* Float32x4WithInstr::MakeLocationSummary(bool opt) const { 3487 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Isolate* isolate,
3488 bool opt) const {
3429 UNIMPLEMENTED(); 3489 UNIMPLEMENTED();
3430 return NULL; 3490 return NULL;
3431 } 3491 }
3432 3492
3433 3493
3434 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3494 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3435 UNIMPLEMENTED(); 3495 UNIMPLEMENTED();
3436 } 3496 }
3437 3497
3438 3498
3439 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(bool opt) const { 3499 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Isolate* isolate,
3500 bool opt) const {
3440 UNIMPLEMENTED(); 3501 UNIMPLEMENTED();
3441 return NULL; 3502 return NULL;
3442 } 3503 }
3443 3504
3444 3505
3445 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3506 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3446 UNIMPLEMENTED(); 3507 UNIMPLEMENTED();
3447 } 3508 }
3448 3509
3449 3510
3450 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(bool opt) const { 3511 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Isolate* isolate,
3512 bool opt) const {
3451 UNIMPLEMENTED(); 3513 UNIMPLEMENTED();
3452 return NULL; 3514 return NULL;
3453 } 3515 }
3454 3516
3455 3517
3456 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3518 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3457 UNIMPLEMENTED(); 3519 UNIMPLEMENTED();
3458 } 3520 }
3459 3521
3460 3522
3461 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(bool opt) const { 3523 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Isolate* isolate,
3524 bool opt) const {
3462 UNIMPLEMENTED(); 3525 UNIMPLEMENTED();
3463 return NULL; 3526 return NULL;
3464 } 3527 }
3465 3528
3466 3529
3467 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3530 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3468 UNIMPLEMENTED(); 3531 UNIMPLEMENTED();
3469 } 3532 }
3470 3533
3471 3534
3472 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(bool opt) const { 3535 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Isolate* isolate,
3536 bool opt) const {
3473 UNIMPLEMENTED(); 3537 UNIMPLEMENTED();
3474 return NULL; 3538 return NULL;
3475 } 3539 }
3476 3540
3477 3541
3478 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3542 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3479 UNIMPLEMENTED(); 3543 UNIMPLEMENTED();
3480 } 3544 }
3481 3545
3482 3546
3483 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( 3547 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary(
3484 bool opt) const { 3548 Isolate* isolate, bool opt) const {
3485 UNIMPLEMENTED(); 3549 UNIMPLEMENTED();
3486 return NULL; 3550 return NULL;
3487 } 3551 }
3488 3552
3489 3553
3490 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3554 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3491 UNIMPLEMENTED(); 3555 UNIMPLEMENTED();
3492 } 3556 }
3493 3557
3494 3558
3495 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( 3559 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary(
3496 bool opt) const { 3560 Isolate* isolate, bool opt) const {
3497 UNIMPLEMENTED(); 3561 UNIMPLEMENTED();
3498 return NULL; 3562 return NULL;
3499 } 3563 }
3500 3564
3501 3565
3502 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3566 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3503 UNIMPLEMENTED(); 3567 UNIMPLEMENTED();
3504 } 3568 }
3505 3569
3506 3570
3507 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( 3571 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary(
3508 bool opt) const { 3572 Isolate* isolate, bool opt) const {
3509 UNIMPLEMENTED(); 3573 UNIMPLEMENTED();
3510 return NULL; 3574 return NULL;
3511 } 3575 }
3512 3576
3513 3577
3514 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3578 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3515 UNIMPLEMENTED(); 3579 UNIMPLEMENTED();
3516 } 3580 }
3517 3581
3518 3582
3519 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(bool opt) const { 3583 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Isolate* isolate,
3584 bool opt) const {
3520 UNIMPLEMENTED(); 3585 UNIMPLEMENTED();
3521 return NULL; 3586 return NULL;
3522 } 3587 }
3523 3588
3524 3589
3525 void Float64x2ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3590 void Float64x2ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3526 UNIMPLEMENTED(); 3591 UNIMPLEMENTED();
3527 } 3592 }
3528 3593
3529 3594
3530 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(bool opt) const { 3595 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Isolate* isolate,
3596 bool opt) const {
3531 UNIMPLEMENTED(); 3597 UNIMPLEMENTED();
3532 return NULL; 3598 return NULL;
3533 } 3599 }
3534 3600
3535 3601
3536 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3602 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3537 UNIMPLEMENTED(); 3603 UNIMPLEMENTED();
3538 } 3604 }
3539 3605
3540 3606
3541 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( 3607 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
3542 bool opt) const { 3608 Isolate* isolate, bool opt) const {
3543 UNIMPLEMENTED(); 3609 UNIMPLEMENTED();
3544 return NULL; 3610 return NULL;
3545 } 3611 }
3546 3612
3547 3613
3548 void Int32x4BoolConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3614 void Int32x4BoolConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3549 UNIMPLEMENTED(); 3615 UNIMPLEMENTED();
3550 } 3616 }
3551 3617
3552 3618
3553 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(bool opt) const { 3619 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Isolate* isolate,
3620 bool opt) const {
3554 UNIMPLEMENTED(); 3621 UNIMPLEMENTED();
3555 return NULL; 3622 return NULL;
3556 } 3623 }
3557 3624
3558 3625
3559 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3626 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3560 UNIMPLEMENTED(); 3627 UNIMPLEMENTED();
3561 } 3628 }
3562 3629
3563 3630
3564 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(bool opt) const { 3631 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Isolate* isolate,
3632 bool opt) const {
3565 UNIMPLEMENTED(); 3633 UNIMPLEMENTED();
3566 return NULL; 3634 return NULL;
3567 } 3635 }
3568 3636
3569 3637
3570 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3638 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3571 UNIMPLEMENTED(); 3639 UNIMPLEMENTED();
3572 } 3640 }
3573 3641
3574 3642
3575 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(bool opt) const { 3643 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Isolate* isolate,
3644 bool opt) const {
3576 UNIMPLEMENTED(); 3645 UNIMPLEMENTED();
3577 return NULL; 3646 return NULL;
3578 } 3647 }
3579 3648
3580 3649
3581 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3650 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3582 UNIMPLEMENTED(); 3651 UNIMPLEMENTED();
3583 } 3652 }
3584 3653
3585 3654
3586 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(bool opt) const { 3655 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Isolate* isolate,
3656 bool opt) const {
3587 UNIMPLEMENTED(); 3657 UNIMPLEMENTED();
3588 return NULL; 3658 return NULL;
3589 } 3659 }
3590 3660
3591 3661
3592 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3662 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3593 UNIMPLEMENTED(); 3663 UNIMPLEMENTED();
3594 } 3664 }
3595 3665
3596 3666
3597 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(bool opt) const { 3667 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Isolate* isolate,
3668 bool opt) const {
3598 UNIMPLEMENTED(); 3669 UNIMPLEMENTED();
3599 return NULL; 3670 return NULL;
3600 } 3671 }
3601 3672
3602 3673
3603 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3674 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3604 UNIMPLEMENTED(); 3675 UNIMPLEMENTED();
3605 } 3676 }
3606 3677
3607 3678
3608 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(bool opt) const { 3679 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Isolate* isolate,
3680 bool opt) const {
3609 UNIMPLEMENTED(); 3681 UNIMPLEMENTED();
3610 return NULL; 3682 return NULL;
3611 } 3683 }
3612 3684
3613 3685
3614 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3686 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3615 UNIMPLEMENTED(); 3687 UNIMPLEMENTED();
3616 } 3688 }
3617 3689
3618 3690
3619 LocationSummary* MathUnaryInstr::MakeLocationSummary(bool opt) const { 3691 LocationSummary* MathUnaryInstr::MakeLocationSummary(Isolate* isolate,
3692 bool opt) const {
3620 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { 3693 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) {
3621 const intptr_t kNumInputs = 1; 3694 const intptr_t kNumInputs = 1;
3622 const intptr_t kNumTemps = 0; 3695 const intptr_t kNumTemps = 0;
3623 LocationSummary* summary = 3696 LocationSummary* summary = new(isolate) LocationSummary(
3624 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 3697 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
3625 summary->set_in(0, Location::FpuRegisterLocation(D6)); 3698 summary->set_in(0, Location::FpuRegisterLocation(D6));
3626 summary->set_out(0, Location::FpuRegisterLocation(D0)); 3699 summary->set_out(0, Location::FpuRegisterLocation(D0));
3627 return summary; 3700 return summary;
3628 } 3701 }
3629 ASSERT((kind() == MathUnaryInstr::kSqrt) || 3702 ASSERT((kind() == MathUnaryInstr::kSqrt) ||
3630 (kind() == MathUnaryInstr::kDoubleSquare)); 3703 (kind() == MathUnaryInstr::kDoubleSquare));
3631 const intptr_t kNumInputs = 1; 3704 const intptr_t kNumInputs = 1;
3632 const intptr_t kNumTemps = 0; 3705 const intptr_t kNumTemps = 0;
3633 LocationSummary* summary = 3706 LocationSummary* summary = new(isolate) LocationSummary(
3634 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3707 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3635 summary->set_in(0, Location::RequiresFpuRegister()); 3708 summary->set_in(0, Location::RequiresFpuRegister());
3636 summary->set_out(0, Location::RequiresFpuRegister()); 3709 summary->set_out(0, Location::RequiresFpuRegister());
3637 return summary; 3710 return summary;
3638 } 3711 }
3639 3712
3640 3713
3641 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3714 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3642 if (kind() == MathUnaryInstr::kSqrt) { 3715 if (kind() == MathUnaryInstr::kSqrt) {
3643 __ sqrtd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); 3716 __ sqrtd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg());
3644 } else if (kind() == MathUnaryInstr::kDoubleSquare) { 3717 } else if (kind() == MathUnaryInstr::kDoubleSquare) {
3645 DRegister val = locs()->in(0).fpu_reg(); 3718 DRegister val = locs()->in(0).fpu_reg();
3646 DRegister result = locs()->out(0).fpu_reg(); 3719 DRegister result = locs()->out(0).fpu_reg();
3647 __ muld(result, val, val); 3720 __ muld(result, val, val);
3648 } else { 3721 } else {
3649 __ CallRuntime(TargetFunction(), InputCount()); 3722 __ CallRuntime(TargetFunction(), InputCount());
3650 } 3723 }
3651 } 3724 }
3652 3725
3653 3726
3654 LocationSummary* MathMinMaxInstr::MakeLocationSummary(bool opt) const { 3727 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate,
3728 bool opt) const {
3655 if (result_cid() == kDoubleCid) { 3729 if (result_cid() == kDoubleCid) {
3656 const intptr_t kNumInputs = 2; 3730 const intptr_t kNumInputs = 2;
3657 const intptr_t kNumTemps = 1; 3731 const intptr_t kNumTemps = 1;
3658 LocationSummary* summary = 3732 LocationSummary* summary = new(isolate) LocationSummary(
3659 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3733 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3660 summary->set_in(0, Location::RequiresFpuRegister()); 3734 summary->set_in(0, Location::RequiresFpuRegister());
3661 summary->set_in(1, Location::RequiresFpuRegister()); 3735 summary->set_in(1, Location::RequiresFpuRegister());
3662 // Reuse the left register so that code can be made shorter. 3736 // Reuse the left register so that code can be made shorter.
3663 summary->set_out(0, Location::SameAsFirstInput()); 3737 summary->set_out(0, Location::SameAsFirstInput());
3664 summary->set_temp(0, Location::RequiresRegister()); 3738 summary->set_temp(0, Location::RequiresRegister());
3665 return summary; 3739 return summary;
3666 } 3740 }
3667 ASSERT(result_cid() == kSmiCid); 3741 ASSERT(result_cid() == kSmiCid);
3668 const intptr_t kNumInputs = 2; 3742 const intptr_t kNumInputs = 2;
3669 const intptr_t kNumTemps = 0; 3743 const intptr_t kNumTemps = 0;
3670 LocationSummary* summary = 3744 LocationSummary* summary = new(isolate) LocationSummary(
3671 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3745 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3672 summary->set_in(0, Location::RequiresRegister()); 3746 summary->set_in(0, Location::RequiresRegister());
3673 summary->set_in(1, Location::RequiresRegister()); 3747 summary->set_in(1, Location::RequiresRegister());
3674 // Reuse the left register so that code can be made shorter. 3748 // Reuse the left register so that code can be made shorter.
3675 summary->set_out(0, Location::SameAsFirstInput()); 3749 summary->set_out(0, Location::SameAsFirstInput());
3676 return summary; 3750 return summary;
3677 } 3751 }
3678 3752
3679 3753
3680 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3754 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3681 ASSERT((op_kind() == MethodRecognizer::kMathMin) || 3755 ASSERT((op_kind() == MethodRecognizer::kMathMin) ||
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
3735 if (is_min) { 3809 if (is_min) {
3736 __ BranchSignedLessEqual(left, right, &done); 3810 __ BranchSignedLessEqual(left, right, &done);
3737 } else { 3811 } else {
3738 __ BranchSignedGreaterEqual(left, right, &done); 3812 __ BranchSignedGreaterEqual(left, right, &done);
3739 } 3813 }
3740 __ mov(result, right); 3814 __ mov(result, right);
3741 __ Bind(&done); 3815 __ Bind(&done);
3742 } 3816 }
3743 3817
3744 3818
3745 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(bool opt) const { 3819 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate,
3820 bool opt) const {
3746 const intptr_t kNumInputs = 1; 3821 const intptr_t kNumInputs = 1;
3747 const intptr_t kNumTemps = 0; 3822 const intptr_t kNumTemps = 0;
3748 LocationSummary* summary = 3823 LocationSummary* summary = new(isolate) LocationSummary(
3749 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3824 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3750 summary->set_in(0, Location::RequiresRegister()); 3825 summary->set_in(0, Location::RequiresRegister());
3751 // We make use of 3-operand instructions by not requiring result register 3826 // We make use of 3-operand instructions by not requiring result register
3752 // to be identical to first input register as on Intel. 3827 // to be identical to first input register as on Intel.
3753 summary->set_out(0, Location::RequiresRegister()); 3828 summary->set_out(0, Location::RequiresRegister());
3754 return summary; 3829 return summary;
3755 } 3830 }
3756 3831
3757 3832
3758 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3833 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3759 Register value = locs()->in(0).reg(); 3834 Register value = locs()->in(0).reg();
3760 Register result = locs()->out(0).reg(); 3835 Register result = locs()->out(0).reg();
3761 switch (op_kind()) { 3836 switch (op_kind()) {
3762 case Token::kNEGATE: { 3837 case Token::kNEGATE: {
3763 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp); 3838 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp);
3764 __ SubuDetectOverflow(result, ZR, value, CMPRES1); 3839 __ SubuDetectOverflow(result, ZR, value, CMPRES1);
3765 __ bltz(CMPRES1, deopt); 3840 __ bltz(CMPRES1, deopt);
3766 break; 3841 break;
3767 } 3842 }
3768 case Token::kBIT_NOT: 3843 case Token::kBIT_NOT:
3769 __ nor(result, value, ZR); 3844 __ nor(result, value, ZR);
3770 __ addiu(result, result, Immediate(-1)); // Remove inverted smi-tag. 3845 __ addiu(result, result, Immediate(-1)); // Remove inverted smi-tag.
3771 break; 3846 break;
3772 default: 3847 default:
3773 UNREACHABLE(); 3848 UNREACHABLE();
3774 } 3849 }
3775 } 3850 }
3776 3851
3777 3852
3778 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(bool opt) const { 3853 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate,
3854 bool opt) const {
3779 const intptr_t kNumInputs = 1; 3855 const intptr_t kNumInputs = 1;
3780 const intptr_t kNumTemps = 1; 3856 const intptr_t kNumTemps = 1;
3781 LocationSummary* summary = 3857 LocationSummary* summary = new(isolate) LocationSummary(
3782 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3858 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3783 summary->set_in(0, Location::RequiresFpuRegister()); 3859 summary->set_in(0, Location::RequiresFpuRegister());
3784 summary->set_out(0, Location::RequiresFpuRegister()); 3860 summary->set_out(0, Location::RequiresFpuRegister());
3785 summary->set_temp(0, Location::RequiresFpuRegister()); 3861 summary->set_temp(0, Location::RequiresFpuRegister());
3786 return summary; 3862 return summary;
3787 } 3863 }
3788 3864
3789 3865
3790 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3866 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3791 // TODO(zra): Implement vneg. 3867 // TODO(zra): Implement vneg.
3792 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1)); 3868 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1));
3793 __ LoadObject(TMP, minus_one); 3869 __ LoadObject(TMP, minus_one);
3794 FpuRegister result = locs()->out(0).fpu_reg(); 3870 FpuRegister result = locs()->out(0).fpu_reg();
3795 FpuRegister value = locs()->in(0).fpu_reg(); 3871 FpuRegister value = locs()->in(0).fpu_reg();
3796 FpuRegister temp_fp = locs()->temp(0).fpu_reg(); 3872 FpuRegister temp_fp = locs()->temp(0).fpu_reg();
3797 __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag); 3873 __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag);
3798 __ muld(result, value, temp_fp); 3874 __ muld(result, value, temp_fp);
3799 } 3875 }
3800 3876
3801 3877
3802 3878
3803 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(bool opt) const { 3879 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate,
3880 bool opt) const {
3804 const intptr_t kNumInputs = 1; 3881 const intptr_t kNumInputs = 1;
3805 const intptr_t kNumTemps = 0; 3882 const intptr_t kNumTemps = 0;
3806 LocationSummary* result = 3883 LocationSummary* result = new(isolate) LocationSummary(
3807 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3884 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3808 result->set_in(0, Location::WritableRegister()); 3885 result->set_in(0, Location::WritableRegister());
3809 result->set_out(0, Location::RequiresFpuRegister()); 3886 result->set_out(0, Location::RequiresFpuRegister());
3810 return result; 3887 return result;
3811 } 3888 }
3812 3889
3813 3890
3814 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3891 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3815 Register value = locs()->in(0).reg(); 3892 Register value = locs()->in(0).reg();
3816 FpuRegister result = locs()->out(0).fpu_reg(); 3893 FpuRegister result = locs()->out(0).fpu_reg();
3817 __ SmiUntag(value); 3894 __ SmiUntag(value);
3818 __ mtc1(value, STMP1); 3895 __ mtc1(value, STMP1);
3819 __ cvtdw(result, STMP1); 3896 __ cvtdw(result, STMP1);
3820 } 3897 }
3821 3898
3822 3899
3823 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(bool opt) const { 3900 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Isolate* isolate,
3901 bool opt) const {
3824 const intptr_t kNumInputs = 1; 3902 const intptr_t kNumInputs = 1;
3825 const intptr_t kNumTemps = 0; 3903 const intptr_t kNumTemps = 0;
3826 LocationSummary* result = 3904 LocationSummary* result = new(isolate) LocationSummary(
3827 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 3905 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
3828 result->set_in(0, Location::RegisterLocation(T1)); 3906 result->set_in(0, Location::RegisterLocation(T1));
3829 result->set_out(0, Location::RegisterLocation(V0)); 3907 result->set_out(0, Location::RegisterLocation(V0));
3830 return result; 3908 return result;
3831 } 3909 }
3832 3910
3833 3911
3834 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3912 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3835 Register result = locs()->out(0).reg(); 3913 Register result = locs()->out(0).reg();
3836 Register value_obj = locs()->in(0).reg(); 3914 Register value_obj = locs()->in(0).reg();
3837 ASSERT(result == V0); 3915 ASSERT(result == V0);
(...skipping 21 matching lines...) Expand all
3859 compiler->GenerateStaticCall(deopt_id(), 3937 compiler->GenerateStaticCall(deopt_id(),
3860 instance_call()->token_pos(), 3938 instance_call()->token_pos(),
3861 target, 3939 target,
3862 kNumberOfArguments, 3940 kNumberOfArguments,
3863 Object::null_array(), // No argument names., 3941 Object::null_array(), // No argument names.,
3864 locs()); 3942 locs());
3865 __ Bind(&done); 3943 __ Bind(&done);
3866 } 3944 }
3867 3945
3868 3946
3869 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(bool opt) const { 3947 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Isolate* isolate,
3948 bool opt) const {
3870 const intptr_t kNumInputs = 1; 3949 const intptr_t kNumInputs = 1;
3871 const intptr_t kNumTemps = 0; 3950 const intptr_t kNumTemps = 0;
3872 LocationSummary* result = new LocationSummary( 3951 LocationSummary* result = new(isolate) LocationSummary(
3873 kNumInputs, kNumTemps, LocationSummary::kNoCall); 3952 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3874 result->set_in(0, Location::RequiresFpuRegister()); 3953 result->set_in(0, Location::RequiresFpuRegister());
3875 result->set_out(0, Location::RequiresRegister()); 3954 result->set_out(0, Location::RequiresRegister());
3876 return result; 3955 return result;
3877 } 3956 }
3878 3957
3879 3958
3880 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3959 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3881 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); 3960 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi);
3882 Register result = locs()->out(0).reg(); 3961 Register result = locs()->out(0).reg();
3883 DRegister value = locs()->in(0).fpu_reg(); 3962 DRegister value = locs()->in(0).fpu_reg();
3884 __ cvtwd(STMP1, value); 3963 __ cvtwd(STMP1, value);
3885 __ mfc1(result, STMP1); 3964 __ mfc1(result, STMP1);
3886 3965
3887 // Check for overflow and that it fits into Smi. 3966 // Check for overflow and that it fits into Smi.
3888 __ LoadImmediate(TMP, 0xC0000000); 3967 __ LoadImmediate(TMP, 0xC0000000);
3889 __ subu(CMPRES1, result, TMP); 3968 __ subu(CMPRES1, result, TMP);
3890 __ bltz(CMPRES1, deopt); 3969 __ bltz(CMPRES1, deopt);
3891 __ SmiTag(result); 3970 __ SmiTag(result);
3892 } 3971 }
3893 3972
3894 3973
3895 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(bool opt) const { 3974 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Isolate* isolate,
3975 bool opt) const {
3896 UNIMPLEMENTED(); 3976 UNIMPLEMENTED();
3897 return NULL; 3977 return NULL;
3898 } 3978 }
3899 3979
3900 3980
3901 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3981 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3902 UNIMPLEMENTED(); 3982 UNIMPLEMENTED();
3903 } 3983 }
3904 3984
3905 3985
3906 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(bool opt) const { 3986 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Isolate* isolate,
3987 bool opt) const {
3907 const intptr_t kNumInputs = 1; 3988 const intptr_t kNumInputs = 1;
3908 const intptr_t kNumTemps = 0; 3989 const intptr_t kNumTemps = 0;
3909 LocationSummary* result = 3990 LocationSummary* result = new(isolate) LocationSummary(
3910 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3991 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3911 result->set_in(0, Location::RequiresFpuRegister()); 3992 result->set_in(0, Location::RequiresFpuRegister());
3912 result->set_out(0, Location::SameAsFirstInput()); 3993 result->set_out(0, Location::SameAsFirstInput());
3913 return result; 3994 return result;
3914 } 3995 }
3915 3996
3916 3997
3917 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3998 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3918 DRegister value = locs()->in(0).fpu_reg(); 3999 DRegister value = locs()->in(0).fpu_reg();
3919 FRegister result = EvenFRegisterOf(locs()->out(0).fpu_reg()); 4000 FRegister result = EvenFRegisterOf(locs()->out(0).fpu_reg());
3920 __ cvtsd(result, value); 4001 __ cvtsd(result, value);
3921 } 4002 }
3922 4003
3923 4004
3924 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(bool opt) const { 4005 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Isolate* isolate,
4006 bool opt) const {
3925 const intptr_t kNumInputs = 1; 4007 const intptr_t kNumInputs = 1;
3926 const intptr_t kNumTemps = 0; 4008 const intptr_t kNumTemps = 0;
3927 LocationSummary* result = 4009 LocationSummary* result = new(isolate) LocationSummary(
3928 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4010 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3929 result->set_in(0, Location::RequiresFpuRegister()); 4011 result->set_in(0, Location::RequiresFpuRegister());
3930 result->set_out(0, Location::SameAsFirstInput()); 4012 result->set_out(0, Location::SameAsFirstInput());
3931 return result; 4013 return result;
3932 } 4014 }
3933 4015
3934 4016
3935 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4017 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3936 FRegister value = EvenFRegisterOf(locs()->in(0).fpu_reg()); 4018 FRegister value = EvenFRegisterOf(locs()->in(0).fpu_reg());
3937 DRegister result = locs()->out(0).fpu_reg(); 4019 DRegister result = locs()->out(0).fpu_reg();
3938 __ cvtds(result, value); 4020 __ cvtds(result, value);
3939 } 4021 }
3940 4022
3941 4023
3942 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const { 4024 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Isolate* isolate,
4025 bool opt) const {
3943 // Calling convention on MIPS uses D6 and D7 to pass the first two 4026 // Calling convention on MIPS uses D6 and D7 to pass the first two
3944 // double arguments. 4027 // double arguments.
3945 ASSERT((InputCount() == 1) || (InputCount() == 2)); 4028 ASSERT((InputCount() == 1) || (InputCount() == 2));
3946 const intptr_t kNumTemps = 0; 4029 const intptr_t kNumTemps = 0;
3947 LocationSummary* result = 4030 LocationSummary* result = new(isolate) LocationSummary(
3948 new LocationSummary(InputCount(), kNumTemps, LocationSummary::kCall); 4031 isolate, InputCount(), kNumTemps, LocationSummary::kCall);
3949 result->set_in(0, Location::FpuRegisterLocation(D6)); 4032 result->set_in(0, Location::FpuRegisterLocation(D6));
3950 if (InputCount() == 2) { 4033 if (InputCount() == 2) {
3951 result->set_in(1, Location::FpuRegisterLocation(D7)); 4034 result->set_in(1, Location::FpuRegisterLocation(D7));
3952 } 4035 }
3953 result->set_out(0, Location::FpuRegisterLocation(D0)); 4036 result->set_out(0, Location::FpuRegisterLocation(D0));
3954 return result; 4037 return result;
3955 } 4038 }
3956 4039
3957 4040
3958 // Pseudo code: 4041 // Pseudo code:
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
4072 // For pow-function return NaN if exponent is NaN. 4155 // For pow-function return NaN if exponent is NaN.
4073 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { 4156 if (recognized_kind() == MethodRecognizer::kMathDoublePow) {
4074 InvokeDoublePow(compiler, this); 4157 InvokeDoublePow(compiler, this);
4075 return; 4158 return;
4076 } 4159 }
4077 // double values are passed and returned in vfp registers. 4160 // double values are passed and returned in vfp registers.
4078 __ CallRuntime(TargetFunction(), InputCount()); 4161 __ CallRuntime(TargetFunction(), InputCount());
4079 } 4162 }
4080 4163
4081 4164
4082 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(bool opt) const { 4165 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Isolate* isolate,
4166 bool opt) const {
4083 // Only use this instruction in optimized code. 4167 // Only use this instruction in optimized code.
4084 ASSERT(opt); 4168 ASSERT(opt);
4085 const intptr_t kNumInputs = 1; 4169 const intptr_t kNumInputs = 1;
4086 LocationSummary* summary = 4170 LocationSummary* summary = new(isolate) LocationSummary(
4087 new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall); 4171 isolate, kNumInputs, 0, LocationSummary::kNoCall);
4088 if (representation() == kUnboxedDouble) { 4172 if (representation() == kUnboxedDouble) {
4089 if (index() == 0) { 4173 if (index() == 0) {
4090 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), 4174 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(),
4091 Location::Any())); 4175 Location::Any()));
4092 } else { 4176 } else {
4093 ASSERT(index() == 1); 4177 ASSERT(index() == 1);
4094 summary->set_in(0, Location::Pair(Location::Any(), 4178 summary->set_in(0, Location::Pair(Location::Any(),
4095 Location::RequiresFpuRegister())); 4179 Location::RequiresFpuRegister()));
4096 } 4180 }
4097 summary->set_out(0, Location::RequiresFpuRegister()); 4181 summary->set_out(0, Location::RequiresFpuRegister());
(...skipping 23 matching lines...) Expand all
4121 __ movd(out, in); 4205 __ movd(out, in);
4122 } else { 4206 } else {
4123 ASSERT(representation() == kTagged); 4207 ASSERT(representation() == kTagged);
4124 Register out = locs()->out(0).reg(); 4208 Register out = locs()->out(0).reg();
4125 Register in = in_loc.reg(); 4209 Register in = in_loc.reg();
4126 __ mov(out, in); 4210 __ mov(out, in);
4127 } 4211 }
4128 } 4212 }
4129 4213
4130 4214
4131 LocationSummary* MergedMathInstr::MakeLocationSummary(bool opt) const { 4215 LocationSummary* MergedMathInstr::MakeLocationSummary(Isolate* isolate,
4216 bool opt) const {
4132 if (kind() == MergedMathInstr::kTruncDivMod) { 4217 if (kind() == MergedMathInstr::kTruncDivMod) {
4133 const intptr_t kNumInputs = 2; 4218 const intptr_t kNumInputs = 2;
4134 const intptr_t kNumTemps = 1; 4219 const intptr_t kNumTemps = 1;
4135 LocationSummary* summary = 4220 LocationSummary* summary = new(isolate) LocationSummary(
4136 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4221 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4137 summary->set_in(0, Location::RequiresRegister()); 4222 summary->set_in(0, Location::RequiresRegister());
4138 summary->set_in(1, Location::RequiresRegister()); 4223 summary->set_in(1, Location::RequiresRegister());
4139 summary->set_temp(0, Location::RequiresRegister()); 4224 summary->set_temp(0, Location::RequiresRegister());
4140 // Output is a pair of registers. 4225 // Output is a pair of registers.
4141 summary->set_out(0, Location::Pair(Location::RequiresRegister(), 4226 summary->set_out(0, Location::Pair(Location::RequiresRegister(),
4142 Location::RequiresRegister())); 4227 Location::RequiresRegister()));
4143 return summary; 4228 return summary;
4144 } 4229 }
4145 UNIMPLEMENTED(); 4230 UNIMPLEMENTED();
4146 return NULL; 4231 return NULL;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
4201 4286
4202 __ SmiTag(result_div); 4287 __ SmiTag(result_div);
4203 __ SmiTag(result_mod); 4288 __ SmiTag(result_mod);
4204 return; 4289 return;
4205 } 4290 }
4206 UNIMPLEMENTED(); 4291 UNIMPLEMENTED();
4207 } 4292 }
4208 4293
4209 4294
4210 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( 4295 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
4211 bool opt) const { 4296 Isolate* isolate, bool opt) const {
4212 return MakeCallSummary(); 4297 return MakeCallSummary();
4213 } 4298 }
4214 4299
4215 4300
4216 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4301 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4217 Label* deopt = compiler->AddDeoptStub( 4302 Label* deopt = compiler->AddDeoptStub(
4218 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); 4303 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail);
4219 __ TraceSimMsg("PolymorphicInstanceCallInstr"); 4304 __ TraceSimMsg("PolymorphicInstanceCallInstr");
4220 if (ic_data().NumberOfChecks() == 0) { 4305 if (ic_data().NumberOfChecks() == 0) {
4221 __ b(deopt); 4306 __ b(deopt);
(...skipping 22 matching lines...) Expand all
4244 T2, // Class id register. 4329 T2, // Class id register.
4245 instance_call()->ArgumentCount(), 4330 instance_call()->ArgumentCount(),
4246 instance_call()->argument_names(), 4331 instance_call()->argument_names(),
4247 deopt, 4332 deopt,
4248 deopt_id(), 4333 deopt_id(),
4249 instance_call()->token_pos(), 4334 instance_call()->token_pos(),
4250 locs()); 4335 locs());
4251 } 4336 }
4252 4337
4253 4338
4254 LocationSummary* BranchInstr::MakeLocationSummary(bool opt) const { 4339 LocationSummary* BranchInstr::MakeLocationSummary(Isolate* isolate,
4255 comparison()->InitializeLocationSummary(opt); 4340 bool opt) const {
4341 comparison()->InitializeLocationSummary(isolate, opt);
4256 // Branches don't produce a result. 4342 // Branches don't produce a result.
4257 comparison()->locs()->set_out(0, Location::NoLocation()); 4343 comparison()->locs()->set_out(0, Location::NoLocation());
4258 return comparison()->locs(); 4344 return comparison()->locs();
4259 } 4345 }
4260 4346
4261 4347
4262 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4348 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4263 __ TraceSimMsg("BranchInstr"); 4349 __ TraceSimMsg("BranchInstr");
4264 comparison()->EmitBranchCode(compiler, this); 4350 comparison()->EmitBranchCode(compiler, this);
4265 } 4351 }
4266 4352
4267 4353
4268 LocationSummary* CheckClassInstr::MakeLocationSummary(bool opt) const { 4354 LocationSummary* CheckClassInstr::MakeLocationSummary(Isolate* isolate,
4355 bool opt) const {
4269 const intptr_t kNumInputs = 1; 4356 const intptr_t kNumInputs = 1;
4270 const intptr_t kNumTemps = 0; 4357 const intptr_t kNumTemps = 0;
4271 LocationSummary* summary = 4358 LocationSummary* summary = new(isolate) LocationSummary(
4272 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4359 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4273 summary->set_in(0, Location::RequiresRegister()); 4360 summary->set_in(0, Location::RequiresRegister());
4274 if (!IsNullCheck()) { 4361 if (!IsNullCheck()) {
4275 summary->AddTemp(Location::RequiresRegister()); 4362 summary->AddTemp(Location::RequiresRegister());
4276 } 4363 }
4277 return summary; 4364 return summary;
4278 } 4365 }
4279 4366
4280 4367
4281 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4368 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4282 const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ? 4369 const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ?
(...skipping 29 matching lines...) Expand all
4312 if (i == (num_checks - 1)) { 4399 if (i == (num_checks - 1)) {
4313 __ bne(CMPRES1, ZR, deopt); 4400 __ bne(CMPRES1, ZR, deopt);
4314 } else { 4401 } else {
4315 __ beq(CMPRES1, ZR, &is_ok); 4402 __ beq(CMPRES1, ZR, &is_ok);
4316 } 4403 }
4317 } 4404 }
4318 __ Bind(&is_ok); 4405 __ Bind(&is_ok);
4319 } 4406 }
4320 4407
4321 4408
4322 LocationSummary* CheckSmiInstr::MakeLocationSummary(bool opt) const { 4409 LocationSummary* CheckSmiInstr::MakeLocationSummary(Isolate* isolate,
4410 bool opt) const {
4323 const intptr_t kNumInputs = 1; 4411 const intptr_t kNumInputs = 1;
4324 const intptr_t kNumTemps = 0; 4412 const intptr_t kNumTemps = 0;
4325 LocationSummary* summary = 4413 LocationSummary* summary = new(isolate) LocationSummary(
4326 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4414 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4327 summary->set_in(0, Location::RequiresRegister()); 4415 summary->set_in(0, Location::RequiresRegister());
4328 return summary; 4416 return summary;
4329 } 4417 }
4330 4418
4331 4419
4332 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4420 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4333 __ TraceSimMsg("CheckSmiInstr"); 4421 __ TraceSimMsg("CheckSmiInstr");
4334 Register value = locs()->in(0).reg(); 4422 Register value = locs()->in(0).reg();
4335 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi); 4423 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi);
4336 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); 4424 __ andi(CMPRES1, value, Immediate(kSmiTagMask));
4337 __ bne(CMPRES1, ZR, deopt); 4425 __ bne(CMPRES1, ZR, deopt);
4338 } 4426 }
4339 4427
4340 4428
4341 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const { 4429 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Isolate* isolate,
4430 bool opt) const {
4342 const intptr_t kNumInputs = 2; 4431 const intptr_t kNumInputs = 2;
4343 const intptr_t kNumTemps = 0; 4432 const intptr_t kNumTemps = 0;
4344 LocationSummary* locs = 4433 LocationSummary* locs = new(isolate) LocationSummary(
4345 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4434 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4346 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); 4435 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
4347 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); 4436 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
4348 return locs; 4437 return locs;
4349 } 4438 }
4350 4439
4351 4440
4352 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4441 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4353 Label* deopt = compiler->AddDeoptStub(deopt_id(), 4442 Label* deopt = compiler->AddDeoptStub(deopt_id(),
4354 ICData::kDeoptCheckArrayBound); 4443 ICData::kDeoptCheckArrayBound);
4355 4444
(...skipping 21 matching lines...) Expand all
4377 __ BranchUnsignedGreaterEqual( 4466 __ BranchUnsignedGreaterEqual(
4378 index, reinterpret_cast<int32_t>(length.raw()), deopt); 4467 index, reinterpret_cast<int32_t>(length.raw()), deopt);
4379 } else { 4468 } else {
4380 Register length = length_loc.reg(); 4469 Register length = length_loc.reg();
4381 Register index = index_loc.reg(); 4470 Register index = index_loc.reg();
4382 __ BranchUnsignedGreaterEqual(index, length, deopt); 4471 __ BranchUnsignedGreaterEqual(index, length, deopt);
4383 } 4472 }
4384 } 4473 }
4385 4474
4386 4475
4387 LocationSummary* UnboxIntegerInstr::MakeLocationSummary(bool opt) const { 4476 LocationSummary* UnboxIntegerInstr::MakeLocationSummary(Isolate* isolate,
4477 bool opt) const {
4388 UNIMPLEMENTED(); 4478 UNIMPLEMENTED();
4389 return NULL; 4479 return NULL;
4390 } 4480 }
4391 4481
4392 4482
4393 void UnboxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4483 void UnboxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4394 UNIMPLEMENTED(); 4484 UNIMPLEMENTED();
4395 } 4485 }
4396 4486
4397 4487
4398 LocationSummary* BoxIntegerInstr::MakeLocationSummary(bool opt) const { 4488 LocationSummary* BoxIntegerInstr::MakeLocationSummary(Isolate* isolate,
4489 bool opt) const {
4399 UNIMPLEMENTED(); 4490 UNIMPLEMENTED();
4400 return NULL; 4491 return NULL;
4401 } 4492 }
4402 4493
4403 4494
4404 void BoxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4495 void BoxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4405 UNIMPLEMENTED(); 4496 UNIMPLEMENTED();
4406 } 4497 }
4407 4498
4408 4499
4409 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(bool opt) const { 4500 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Isolate* isolate,
4501 bool opt) const {
4410 UNIMPLEMENTED(); 4502 UNIMPLEMENTED();
4411 return NULL; 4503 return NULL;
4412 } 4504 }
4413 4505
4414 4506
4415 void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4507 void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4416 UNIMPLEMENTED(); 4508 UNIMPLEMENTED();
4417 } 4509 }
4418 4510
4419 4511
4420 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(bool opt) const { 4512 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Isolate* isolate,
4513 bool opt) const {
4421 UNIMPLEMENTED(); 4514 UNIMPLEMENTED();
4422 return NULL; 4515 return NULL;
4423 } 4516 }
4424 4517
4425 4518
4426 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4519 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4427 UNIMPLEMENTED(); 4520 UNIMPLEMENTED();
4428 } 4521 }
4429 4522
4430 4523
4431 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(bool opt) const { 4524 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Isolate* isolate,
4525 bool opt) const {
4432 UNIMPLEMENTED(); 4526 UNIMPLEMENTED();
4433 return NULL; 4527 return NULL;
4434 } 4528 }
4435 4529
4436 4530
4437 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4531 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4438 UNIMPLEMENTED(); 4532 UNIMPLEMENTED();
4439 } 4533 }
4440 4534
4441 4535
4442 LocationSummary* ThrowInstr::MakeLocationSummary(bool opt) const { 4536 LocationSummary* ThrowInstr::MakeLocationSummary(Isolate* isolate,
4443 return new LocationSummary(0, 0, LocationSummary::kCall); 4537 bool opt) const {
4538 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall);
4444 } 4539 }
4445 4540
4446 4541
4447 4542
4448 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4543 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4449 compiler->GenerateRuntimeCall(token_pos(), 4544 compiler->GenerateRuntimeCall(token_pos(),
4450 deopt_id(), 4545 deopt_id(),
4451 kThrowRuntimeEntry, 4546 kThrowRuntimeEntry,
4452 1, 4547 1,
4453 locs()); 4548 locs());
4454 __ break_(0); 4549 __ break_(0);
4455 } 4550 }
4456 4551
4457 4552
4458 LocationSummary* ReThrowInstr::MakeLocationSummary(bool opt) const { 4553 LocationSummary* ReThrowInstr::MakeLocationSummary(Isolate* isolate,
4459 return new LocationSummary(0, 0, LocationSummary::kCall); 4554 bool opt) const {
4555 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall);
4460 } 4556 }
4461 4557
4462 4558
4463 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4559 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4464 compiler->SetNeedsStacktrace(catch_try_index()); 4560 compiler->SetNeedsStacktrace(catch_try_index());
4465 compiler->GenerateRuntimeCall(token_pos(), 4561 compiler->GenerateRuntimeCall(token_pos(),
4466 deopt_id(), 4562 deopt_id(),
4467 kReThrowRuntimeEntry, 4563 kReThrowRuntimeEntry,
4468 2, 4564 2,
4469 locs()); 4565 locs());
(...skipping 18 matching lines...) Expand all
4488 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, 4584 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
4489 deopt_id_, 4585 deopt_id_,
4490 Scanner::kNoSourcePos); 4586 Scanner::kNoSourcePos);
4491 } 4587 }
4492 if (HasParallelMove()) { 4588 if (HasParallelMove()) {
4493 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 4589 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
4494 } 4590 }
4495 } 4591 }
4496 4592
4497 4593
4498 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { 4594 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate,
4499 return new LocationSummary(0, 0, LocationSummary::kNoCall); 4595 bool opt) const {
4596 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall);
4500 } 4597 }
4501 4598
4502 4599
4503 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4600 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4504 __ TraceSimMsg("GotoInstr"); 4601 __ TraceSimMsg("GotoInstr");
4505 if (!compiler->is_optimizing()) { 4602 if (!compiler->is_optimizing()) {
4506 compiler->EmitEdgeCounter(); 4603 compiler->EmitEdgeCounter();
4507 // Add a deoptimization descriptor for deoptimizing instructions that 4604 // Add a deoptimization descriptor for deoptimizing instructions that
4508 // may be inserted before this instruction. On MIPS this descriptor 4605 // may be inserted before this instruction. On MIPS this descriptor
4509 // points after the edge counter code so that we can reuse the same 4606 // points after the edge counter code so that we can reuse the same
4510 // pattern matching code as at call sites, which matches backwards from 4607 // pattern matching code as at call sites, which matches backwards from
4511 // the end of the pattern. 4608 // the end of the pattern.
4512 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, 4609 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
4513 GetDeoptId(), 4610 GetDeoptId(),
4514 Scanner::kNoSourcePos); 4611 Scanner::kNoSourcePos);
4515 } 4612 }
4516 if (HasParallelMove()) { 4613 if (HasParallelMove()) {
4517 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 4614 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
4518 } 4615 }
4519 4616
4520 // We can fall through if the successor is the next block in the list. 4617 // We can fall through if the successor is the next block in the list.
4521 // Otherwise, we need a jump. 4618 // Otherwise, we need a jump.
4522 if (!compiler->CanFallThroughTo(successor())) { 4619 if (!compiler->CanFallThroughTo(successor())) {
4523 __ b(compiler->GetJumpLabel(successor())); 4620 __ b(compiler->GetJumpLabel(successor()));
4524 } 4621 }
4525 } 4622 }
4526 4623
4527 4624
4528 LocationSummary* CurrentContextInstr::MakeLocationSummary(bool opt) const { 4625 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate,
4626 bool opt) const {
4529 return LocationSummary::Make(0, 4627 return LocationSummary::Make(0,
4530 Location::RequiresRegister(), 4628 Location::RequiresRegister(),
4531 LocationSummary::kNoCall); 4629 LocationSummary::kNoCall);
4532 } 4630 }
4533 4631
4534 4632
4535 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4633 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4536 __ mov(locs()->out(0).reg(), CTX); 4634 __ mov(locs()->out(0).reg(), CTX);
4537 } 4635 }
4538 4636
4539 4637
4540 LocationSummary* StrictCompareInstr::MakeLocationSummary(bool opt) const { 4638 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate,
4639 bool opt) const {
4541 const intptr_t kNumInputs = 2; 4640 const intptr_t kNumInputs = 2;
4542 const intptr_t kNumTemps = 0; 4641 const intptr_t kNumTemps = 0;
4543 if (needs_number_check()) { 4642 if (needs_number_check()) {
4544 LocationSummary* locs = 4643 LocationSummary* locs = new(isolate) LocationSummary(
4545 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 4644 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
4546 locs->set_in(0, Location::RegisterLocation(A0)); 4645 locs->set_in(0, Location::RegisterLocation(A0));
4547 locs->set_in(1, Location::RegisterLocation(A1)); 4646 locs->set_in(1, Location::RegisterLocation(A1));
4548 locs->set_out(0, Location::RegisterLocation(A0)); 4647 locs->set_out(0, Location::RegisterLocation(A0));
4549 return locs; 4648 return locs;
4550 } 4649 }
4551 LocationSummary* locs = 4650 LocationSummary* locs = new(isolate) LocationSummary(
4552 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4651 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4553 locs->set_in(0, Location::RegisterOrConstant(left())); 4652 locs->set_in(0, Location::RegisterOrConstant(left()));
4554 // Only one of the inputs can be a constant. Choose register if the first one 4653 // Only one of the inputs can be a constant. Choose register if the first one
4555 // is a constant. 4654 // is a constant.
4556 locs->set_in(1, locs->in(0).IsConstant() 4655 locs->set_in(1, locs->in(0).IsConstant()
4557 ? Location::RequiresRegister() 4656 ? Location::RequiresRegister()
4558 : Location::RegisterOrConstant(right())); 4657 : Location::RegisterOrConstant(right()));
4559 locs->set_out(0, Location::RequiresRegister()); 4658 locs->set_out(0, Location::RequiresRegister());
4560 return locs; 4659 return locs;
4561 } 4660 }
4562 4661
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
4612 BranchInstr* branch) { 4711 BranchInstr* branch) {
4613 __ TraceSimMsg("StrictCompareInstr::EmitBranchCode"); 4712 __ TraceSimMsg("StrictCompareInstr::EmitBranchCode");
4614 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); 4713 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
4615 4714
4616 BranchLabels labels = compiler->CreateBranchLabels(branch); 4715 BranchLabels labels = compiler->CreateBranchLabels(branch);
4617 Condition true_condition = EmitComparisonCode(compiler, labels); 4716 Condition true_condition = EmitComparisonCode(compiler, labels);
4618 EmitBranchOnCondition(compiler, true_condition, labels); 4717 EmitBranchOnCondition(compiler, true_condition, labels);
4619 } 4718 }
4620 4719
4621 4720
4622 LocationSummary* BooleanNegateInstr::MakeLocationSummary(bool opt) const { 4721 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate,
4722 bool opt) const {
4623 return LocationSummary::Make(1, 4723 return LocationSummary::Make(1,
4624 Location::RequiresRegister(), 4724 Location::RequiresRegister(),
4625 LocationSummary::kNoCall); 4725 LocationSummary::kNoCall);
4626 } 4726 }
4627 4727
4628 4728
4629 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4729 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4630 Register value = locs()->in(0).reg(); 4730 Register value = locs()->in(0).reg();
4631 Register result = locs()->out(0).reg(); 4731 Register result = locs()->out(0).reg();
4632 4732
4633 __ LoadObject(result, Bool::True()); 4733 __ LoadObject(result, Bool::True());
4634 __ LoadObject(TMP, Bool::False()); 4734 __ LoadObject(TMP, Bool::False());
4635 __ subu(CMPRES1, value, result); 4735 __ subu(CMPRES1, value, result);
4636 __ movz(result, TMP, CMPRES1); // If value is True, move False into result. 4736 __ movz(result, TMP, CMPRES1); // If value is True, move False into result.
4637 } 4737 }
4638 4738
4639 4739
4640 LocationSummary* AllocateObjectInstr::MakeLocationSummary(bool opt) const { 4740 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate,
4741 bool opt) const {
4641 return MakeCallSummary(); 4742 return MakeCallSummary();
4642 } 4743 }
4643 4744
4644 4745
4645 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4746 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4646 __ TraceSimMsg("AllocateObjectInstr"); 4747 __ TraceSimMsg("AllocateObjectInstr");
4647 __ Comment("AllocateObjectInstr"); 4748 __ Comment("AllocateObjectInstr");
4648 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); 4749 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls()));
4649 const ExternalLabel label(cls().ToCString(), stub.EntryPoint()); 4750 const ExternalLabel label(cls().ToCString(), stub.EntryPoint());
4650 compiler->GenerateCall(token_pos(), 4751 compiler->GenerateCall(token_pos(),
4651 &label, 4752 &label,
4652 PcDescriptors::kOther, 4753 PcDescriptors::kOther,
4653 locs()); 4754 locs());
4654 __ Drop(ArgumentCount()); // Discard arguments. 4755 __ Drop(ArgumentCount()); // Discard arguments.
4655 } 4756 }
4656 4757
4657 } // namespace dart 4758 } // namespace dart
4658 4759
4659 #endif // defined TARGET_ARCH_MIPS 4760 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698