| 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/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 __ cmpq(RCX, raw_null); | 1601 __ cmpq(RCX, raw_null); |
| 1602 __ j(NOT_EQUAL, &done); | 1602 __ j(NOT_EQUAL, &done); |
| 1603 } | 1603 } |
| 1604 } | 1604 } |
| 1605 } | 1605 } |
| 1606 } | 1606 } |
| 1607 __ Bind(&runtime_call); | 1607 __ Bind(&runtime_call); |
| 1608 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 1608 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
| 1609 const Immediate location = | 1609 const Immediate location = |
| 1610 Immediate(reinterpret_cast<int64_t>(Smi::New(token_index))); | 1610 Immediate(reinterpret_cast<int64_t>(Smi::New(token_index))); |
| 1611 const Immediate node_id_as_smi = |
| 1612 Immediate(reinterpret_cast<int64_t>(Smi::New(node_id))); |
| 1611 __ pushq(location); // Push the source location. | 1613 __ pushq(location); // Push the source location. |
| 1614 __ pushq(node_id_as_smi); // node-id. |
| 1612 __ pushq(RAX); // Push the source object. | 1615 __ pushq(RAX); // Push the source object. |
| 1613 __ PushObject(dst_type); // Push the type of the destination. | 1616 __ PushObject(dst_type); // Push the type of the destination. |
| 1614 if (!dst_type.IsInstantiated()) { | 1617 if (!dst_type.IsInstantiated()) { |
| 1615 GenerateInstantiatorTypeArguments(token_index); | 1618 GenerateInstantiatorTypeArguments(token_index); |
| 1616 } else { | 1619 } else { |
| 1617 __ pushq(raw_null); // Null instantiator. | 1620 __ pushq(raw_null); // Null instantiator. |
| 1618 } | 1621 } |
| 1619 __ PushObject(dst_name); // Push the name of the destination. | 1622 __ PushObject(dst_name); // Push the name of the destination. |
| 1620 GenerateCallRuntime(node_id, token_index, kTypeCheckRuntimeEntry); | 1623 GenerateCallRuntime(node_id, token_index, kTypeCheckRuntimeEntry); |
| 1621 // Pop the parameters supplied to the runtime entry. The result of the | 1624 // Pop the parameters supplied to the runtime entry. The result of the |
| 1622 // type check runtime call is the checked value. | 1625 // type check runtime call is the checked value. |
| 1623 __ addq(RSP, Immediate(5 * kWordSize)); | 1626 __ addq(RSP, Immediate(6 * kWordSize)); |
| 1624 __ popq(RAX); | 1627 __ popq(RAX); |
| 1625 | 1628 |
| 1626 __ Bind(&done); | 1629 __ Bind(&done); |
| 1627 } | 1630 } |
| 1628 | 1631 |
| 1629 | 1632 |
| 1630 void CodeGenerator::GenerateArgumentTypeChecks() { | 1633 void CodeGenerator::GenerateArgumentTypeChecks() { |
| 1631 const Function& function = parsed_function_.function(); | 1634 const Function& function = parsed_function_.function(); |
| 1632 const SequenceNode& sequence_node = *parsed_function_.node_sequence(); | 1635 const SequenceNode& sequence_node = *parsed_function_.node_sequence(); |
| 1633 LocalScope* scope = sequence_node.scope(); | 1636 LocalScope* scope = sequence_node.scope(); |
| (...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2725 const Error& error = Error::Handle( | 2728 const Error& error = Error::Handle( |
| 2726 Parser::FormatError(script, token_index, "Error", format, args)); | 2729 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2727 va_end(args); | 2730 va_end(args); |
| 2728 Isolate::Current()->long_jump_base()->Jump(1, error); | 2731 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2729 UNREACHABLE(); | 2732 UNREACHABLE(); |
| 2730 } | 2733 } |
| 2731 | 2734 |
| 2732 } // namespace dart | 2735 } // namespace dart |
| 2733 | 2736 |
| 2734 #endif // defined TARGET_ARCH_X64 | 2737 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |