| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 locs->set_in(0, Location::RegisterLocation(EAX)); | 197 locs->set_in(0, Location::RegisterLocation(EAX)); |
| 198 locs->set_out(Location::RegisterLocation(EAX)); | 198 locs->set_out(Location::RegisterLocation(EAX)); |
| 199 return locs; | 199 return locs; |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| 203 void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 203 void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 204 Register obj = locs()->in(0).reg(); | 204 Register obj = locs()->in(0).reg(); |
| 205 Register result = locs()->out().reg(); | 205 Register result = locs()->out().reg(); |
| 206 | 206 |
| 207 // Check that the type of the value is allowed in conditional context. | 207 if (!IsEliminated()) { |
| 208 // Call the runtime if the object is not bool::true or bool::false. | 208 // Check that the type of the value is allowed in conditional context. |
| 209 Label done; | 209 // Call the runtime if the object is not bool::true or bool::false. |
| 210 __ CompareObject(obj, compiler->bool_true()); | 210 Label done; |
| 211 __ j(EQUAL, &done, Assembler::kNearJump); | 211 __ CompareObject(obj, compiler->bool_true()); |
| 212 __ CompareObject(obj, compiler->bool_false()); | 212 __ j(EQUAL, &done, Assembler::kNearJump); |
| 213 __ j(EQUAL, &done, Assembler::kNearJump); | 213 __ CompareObject(obj, compiler->bool_false()); |
| 214 __ j(EQUAL, &done, Assembler::kNearJump); |
| 214 | 215 |
| 215 __ pushl(obj); // Push the source object. | 216 __ pushl(obj); // Push the source object. |
| 216 compiler->GenerateCallRuntime(deopt_id(), | 217 compiler->GenerateCallRuntime(deopt_id(), |
| 217 token_pos(), | 218 token_pos(), |
| 218 try_index(), | 219 try_index(), |
| 219 kConditionTypeErrorRuntimeEntry); | 220 kConditionTypeErrorRuntimeEntry); |
| 220 // We should never return here. | 221 // We should never return here. |
| 221 __ int3(); | 222 __ int3(); |
| 222 | 223 |
| 223 __ Bind(&done); | 224 __ Bind(&done); |
| 225 } |
| 224 ASSERT(obj == result); | 226 ASSERT(obj == result); |
| 225 } | 227 } |
| 226 | 228 |
| 227 | 229 |
| 228 static Condition TokenKindToSmiCondition(Token::Kind kind) { | 230 static Condition TokenKindToSmiCondition(Token::Kind kind) { |
| 229 switch (kind) { | 231 switch (kind) { |
| 230 case Token::kEQ: return EQUAL; | 232 case Token::kEQ: return EQUAL; |
| 231 case Token::kNE: return NOT_EQUAL; | 233 case Token::kNE: return NOT_EQUAL; |
| 232 case Token::kLT: return LESS; | 234 case Token::kLT: return LESS; |
| 233 case Token::kGT: return GREATER; | 235 case Token::kGT: return GREATER; |
| (...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 kNumArgsChecked); | 2098 kNumArgsChecked); |
| 2097 __ CompareObject(EAX, compiler->bool_true()); | 2099 __ CompareObject(EAX, compiler->bool_true()); |
| 2098 EmitBranchOnCondition(compiler, branch_condition); | 2100 EmitBranchOnCondition(compiler, branch_condition); |
| 2099 } | 2101 } |
| 2100 | 2102 |
| 2101 } // namespace dart | 2103 } // namespace dart |
| 2102 | 2104 |
| 2103 #undef __ | 2105 #undef __ |
| 2104 | 2106 |
| 2105 #endif // defined TARGET_ARCH_X64 | 2107 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |