OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 ObjectStore* object_store = Isolate::Current()->object_store(); | 352 ObjectStore* object_store = Isolate::Current()->object_store(); |
353 Condition cond = TokenKindToSmiCondition(kind); | 353 Condition cond = TokenKindToSmiCondition(kind); |
354 Label done; | 354 Label done; |
355 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { | 355 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { |
356 // Assert that the Smi is at position 0, if at all. | 356 // Assert that the Smi is at position 0, if at all. |
357 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0)); | 357 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0)); |
358 Label next_test; | 358 Label next_test; |
359 __ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); | 359 __ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); |
360 __ j(NOT_EQUAL, &next_test); | 360 __ j(NOT_EQUAL, &next_test); |
361 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); | 361 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); |
362 if (target.owner() == object_store->object_class()) { | 362 if (target.Owner() == object_store->object_class()) { |
363 // Object.== is same as ===. | 363 // Object.== is same as ===. |
364 __ Drop(2); | 364 __ Drop(2); |
365 __ cmpq(left, right); | 365 __ cmpq(left, right); |
366 if (branch != NULL) { | 366 if (branch != NULL) { |
367 branch->EmitBranchOnCondition(compiler, cond); | 367 branch->EmitBranchOnCondition(compiler, cond); |
368 } else { | 368 } else { |
369 // This case should be rare. | 369 // This case should be rare. |
370 Register result = locs.out().reg(); | 370 Register result = locs.out().reg(); |
371 Label load_true; | 371 Label load_true; |
372 __ j(cond, &load_true, Assembler::kNearJump); | 372 __ j(cond, &load_true, Assembler::kNearJump); |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 1103 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
1104 locs->set_in(0, Location::RegisterLocation(RAX)); | 1104 locs->set_in(0, Location::RegisterLocation(RAX)); |
1105 locs->set_in(1, Location::RegisterLocation(RCX)); | 1105 locs->set_in(1, Location::RegisterLocation(RCX)); |
1106 locs->set_out(Location::RegisterLocation(RAX)); | 1106 locs->set_out(Location::RegisterLocation(RAX)); |
1107 return locs; | 1107 return locs; |
1108 } | 1108 } |
1109 | 1109 |
1110 | 1110 |
1111 void AllocateObjectWithBoundsCheckComp::EmitNativeCode( | 1111 void AllocateObjectWithBoundsCheckComp::EmitNativeCode( |
1112 FlowGraphCompiler* compiler) { | 1112 FlowGraphCompiler* compiler) { |
1113 const Class& cls = Class::ZoneHandle(constructor().owner()); | 1113 const Class& cls = Class::ZoneHandle(constructor().Owner()); |
1114 Register type_arguments = locs()->in(0).reg(); | 1114 Register type_arguments = locs()->in(0).reg(); |
1115 Register instantiator_type_arguments = locs()->in(1).reg(); | 1115 Register instantiator_type_arguments = locs()->in(1).reg(); |
1116 Register result = locs()->out().reg(); | 1116 Register result = locs()->out().reg(); |
1117 | 1117 |
1118 // Push the result place holder initialized to NULL. | 1118 // Push the result place holder initialized to NULL. |
1119 __ PushObject(Object::ZoneHandle()); | 1119 __ PushObject(Object::ZoneHandle()); |
1120 __ PushObject(cls); | 1120 __ PushObject(cls); |
1121 __ pushq(type_arguments); | 1121 __ pushq(type_arguments); |
1122 __ pushq(instantiator_type_arguments); | 1122 __ pushq(instantiator_type_arguments); |
1123 compiler->GenerateCallRuntime(deopt_id(), | 1123 compiler->GenerateCallRuntime(deopt_id(), |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 kNumArgsChecked); | 2180 kNumArgsChecked); |
2181 __ CompareObject(RAX, compiler->bool_true()); | 2181 __ CompareObject(RAX, compiler->bool_true()); |
2182 EmitBranchOnCondition(compiler, branch_condition); | 2182 EmitBranchOnCondition(compiler, branch_condition); |
2183 } | 2183 } |
2184 | 2184 |
2185 } // namespace dart | 2185 } // namespace dart |
2186 | 2186 |
2187 #undef __ | 2187 #undef __ |
2188 | 2188 |
2189 #endif // defined TARGET_ARCH_X64 | 2189 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |