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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 comp->dst_type(), | 432 comp->dst_type(), |
433 comp->dst_name()); | 433 comp->dst_name()); |
434 } | 434 } |
435 | 435 |
436 | 436 |
437 void FlowGraphCompiler::VisitAssertBoolean(AssertBooleanComp* comp) { | 437 void FlowGraphCompiler::VisitAssertBoolean(AssertBooleanComp* comp) { |
438 LoadValue(RAX, comp->value()); | 438 LoadValue(RAX, comp->value()); |
439 // Check that the type of the value is allowed in conditional context. | 439 // Check that the type of the value is allowed in conditional context. |
440 // Call the runtime if the object is not bool::true or bool::false. | 440 // Call the runtime if the object is not bool::true or bool::false. |
441 Label done; | 441 Label done; |
442 __ popq(RAX); | |
443 __ CompareObject(RAX, Bool::ZoneHandle(Bool::True())); | 442 __ CompareObject(RAX, Bool::ZoneHandle(Bool::True())); |
444 __ j(EQUAL, &done, Assembler::kNearJump); | 443 __ j(EQUAL, &done, Assembler::kNearJump); |
445 __ CompareObject(RAX, Bool::ZoneHandle(Bool::False())); | 444 __ CompareObject(RAX, Bool::ZoneHandle(Bool::False())); |
446 __ j(EQUAL, &done, Assembler::kNearJump); | 445 __ j(EQUAL, &done, Assembler::kNearJump); |
447 | 446 |
448 const Immediate location = | 447 const Immediate location = |
449 Immediate(reinterpret_cast<int64_t>(Smi::New(comp->token_index()))); | 448 Immediate(reinterpret_cast<int64_t>(Smi::New(comp->token_index()))); |
450 __ pushq(location); // Push the source location. | 449 __ pushq(location); // Push the source location. |
451 __ pushq(RAX); // Push the source object. | 450 __ pushq(RAX); // Push the source object. |
452 GenerateCallRuntime(comp->node_id(), | 451 GenerateCallRuntime(comp->node_id(), |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 ASSERT(exception_handlers_list_ != NULL); | 1658 ASSERT(exception_handlers_list_ != NULL); |
1660 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( | 1659 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( |
1661 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); | 1660 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); |
1662 code.set_exception_handlers(handlers); | 1661 code.set_exception_handlers(handlers); |
1663 } | 1662 } |
1664 | 1663 |
1665 | 1664 |
1666 } // namespace dart | 1665 } // namespace dart |
1667 | 1666 |
1668 #endif // defined TARGET_ARCH_X64 | 1667 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |