OLD | NEW |
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_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 "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 static void EmitAssertBoolean(Register reg, | 240 static void EmitAssertBoolean(Register reg, |
241 TokenPosition token_pos, | 241 TokenPosition token_pos, |
242 intptr_t deopt_id, | 242 intptr_t deopt_id, |
243 LocationSummary* locs, | 243 LocationSummary* locs, |
244 FlowGraphCompiler* compiler) { | 244 FlowGraphCompiler* compiler) { |
245 // Check that the type of the value is allowed in conditional context. | 245 // Check that the type of the value is allowed in conditional context. |
246 // Call the runtime if the object is not bool::true or bool::false. | 246 // Call the runtime if the object is not bool::true or bool::false. |
247 ASSERT(locs->always_calls()); | 247 ASSERT(locs->always_calls()); |
248 Label done; | 248 Label done; |
249 | 249 |
250 if (Isolate::Current()->flags().type_checks()) { | 250 if (Isolate::Current()->type_checks()) { |
251 __ CompareObject(reg, Bool::True()); | 251 __ CompareObject(reg, Bool::True()); |
252 __ j(EQUAL, &done, Assembler::kNearJump); | 252 __ j(EQUAL, &done, Assembler::kNearJump); |
253 __ CompareObject(reg, Bool::False()); | 253 __ CompareObject(reg, Bool::False()); |
254 __ j(EQUAL, &done, Assembler::kNearJump); | 254 __ j(EQUAL, &done, Assembler::kNearJump); |
255 } else { | 255 } else { |
256 ASSERT(Isolate::Current()->flags().asserts()); | 256 ASSERT(Isolate::Current()->asserts()); |
257 __ CompareObject(reg, Object::null_instance()); | 257 __ CompareObject(reg, Object::null_instance()); |
258 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | 258 __ j(NOT_EQUAL, &done, Assembler::kNearJump); |
259 } | 259 } |
260 | 260 |
261 __ pushl(reg); // Push the source object. | 261 __ pushl(reg); // Push the source object. |
262 compiler->GenerateRuntimeCall(token_pos, | 262 compiler->GenerateRuntimeCall(token_pos, |
263 deopt_id, | 263 deopt_id, |
264 kNonBoolTypeErrorRuntimeEntry, | 264 kNonBoolTypeErrorRuntimeEntry, |
265 1, | 265 1, |
266 locs); | 266 locs); |
(...skipping 6565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6832 __ Drop(1); | 6832 __ Drop(1); |
6833 __ popl(result); | 6833 __ popl(result); |
6834 } | 6834 } |
6835 | 6835 |
6836 | 6836 |
6837 } // namespace dart | 6837 } // namespace dart |
6838 | 6838 |
6839 #undef __ | 6839 #undef __ |
6840 | 6840 |
6841 #endif // defined TARGET_ARCH_IA32 | 6841 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |