| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 compiler->GenerateCallRuntime(cid(), | 106 compiler->GenerateCallRuntime(cid(), |
| 107 token_index(), | 107 token_index(), |
| 108 try_index(), | 108 try_index(), |
| 109 kReThrowRuntimeEntry); | 109 kReThrowRuntimeEntry); |
| 110 __ int3(); | 110 __ int3(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 | 113 |
| 114 LocationSummary* BranchInstr::MakeLocationSummary() const { | 114 LocationSummary* BranchInstr::MakeLocationSummary() const { |
| 115 const int kNumInputs = 1; | 115 const int kNumInputs = 1; |
| 116 const int kNumTemps = 1; | 116 const int kNumTemps = 0; |
| 117 LocationSummary* locs = new LocationSummary(kNumInputs, kNumTemps); | 117 LocationSummary* locs = new LocationSummary(kNumInputs, kNumTemps); |
| 118 locs->set_in(0, Location::RequiresRegister()); | 118 locs->set_in(0, Location::RequiresRegister()); |
| 119 locs->set_temp(0, Location::RequiresRegister()); | |
| 120 return locs; | 119 return locs; |
| 121 } | 120 } |
| 122 | 121 |
| 123 | 122 |
| 124 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 123 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 125 Register value = locs()->in(0).reg(); | 124 Register value = locs()->in(0).reg(); |
| 126 Register temp = locs()->temp(0).reg(); | |
| 127 | 125 |
| 128 __ LoadObject(temp, Bool::ZoneHandle(Bool::True())); | 126 __ CompareObject(value, Bool::ZoneHandle(Bool::True())); |
| 129 __ cmpq(value, temp); | |
| 130 if (compiler->IsNextBlock(false_successor())) { | 127 if (compiler->IsNextBlock(false_successor())) { |
| 131 // If the next block is the false sucessor we will fall through to it if | 128 // If the next block is the false sucessor we will fall through to it if |
| 132 // comparison with true fails. | 129 // comparison with true fails. |
| 133 __ j(EQUAL, compiler->GetBlockLabel(true_successor())); | 130 __ j(EQUAL, compiler->GetBlockLabel(true_successor())); |
| 134 } else { | 131 } else { |
| 135 // If the next block is the true sucessor we negate comparison and fall | 132 // If the next block is the true sucessor we negate comparison and fall |
| 136 // through to it. | 133 // through to it. |
| 137 __ j(NOT_EQUAL, compiler->GetBlockLabel(false_successor())); | 134 __ j(NOT_EQUAL, compiler->GetBlockLabel(false_successor())); |
| 138 } | 135 } |
| 139 } | 136 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 239 |
| 243 Register left = locs()->in(0).reg(); | 240 Register left = locs()->in(0).reg(); |
| 244 Register right = locs()->in(1).reg(); | 241 Register right = locs()->in(1).reg(); |
| 245 Register result = locs()->out().reg(); | 242 Register result = locs()->out().reg(); |
| 246 | 243 |
| 247 __ cmpq(left, right); | 244 __ cmpq(left, right); |
| 248 Label load_true, done; | 245 Label load_true, done; |
| 249 if (kind() == Token::kEQ_STRICT) { | 246 if (kind() == Token::kEQ_STRICT) { |
| 250 __ j(EQUAL, &load_true, Assembler::kNearJump); | 247 __ j(EQUAL, &load_true, Assembler::kNearJump); |
| 251 } else { | 248 } else { |
| 249 ASSERT(kind() == Token::kNE_STRICT); |
| 252 __ j(NOT_EQUAL, &load_true, Assembler::kNearJump); | 250 __ j(NOT_EQUAL, &load_true, Assembler::kNearJump); |
| 253 } | 251 } |
| 254 __ LoadObject(result, bool_false); | 252 __ LoadObject(result, bool_false); |
| 255 __ jmp(&done, Assembler::kNearJump); | 253 __ jmp(&done, Assembler::kNearJump); |
| 256 __ Bind(&load_true); | 254 __ Bind(&load_true); |
| 257 __ LoadObject(result, bool_true); | 255 __ LoadObject(result, bool_true); |
| 258 __ Bind(&done); | 256 __ Bind(&done); |
| 259 } | 257 } |
| 260 | 258 |
| 261 | 259 |
| (...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1428 } else { | 1426 } else { |
| 1429 UNREACHABLE(); | 1427 UNREACHABLE(); |
| 1430 } | 1428 } |
| 1431 } | 1429 } |
| 1432 | 1430 |
| 1433 } // namespace dart | 1431 } // namespace dart |
| 1434 | 1432 |
| 1435 #undef __ | 1433 #undef __ |
| 1436 | 1434 |
| 1437 #endif // defined TARGET_ARCH_X64 | 1435 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |