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 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 // type check runtime call is the checked value. | 1622 // type check runtime call is the checked value. |
1623 __ addq(RSP, Immediate(5 * kWordSize)); | 1623 __ addq(RSP, Immediate(5 * kWordSize)); |
1624 __ popq(RAX); | 1624 __ popq(RAX); |
1625 | 1625 |
1626 __ Bind(&done); | 1626 __ Bind(&done); |
1627 } | 1627 } |
1628 | 1628 |
1629 | 1629 |
1630 void CodeGenerator::GenerateArgumentTypeChecks() { | 1630 void CodeGenerator::GenerateArgumentTypeChecks() { |
1631 const Function& function = parsed_function_.function(); | 1631 const Function& function = parsed_function_.function(); |
1632 LocalScope* scope = parsed_function_.node_sequence()->scope(); | 1632 const SequenceNode& sequence_node = *parsed_function_.node_sequence(); |
| 1633 LocalScope* scope = sequence_node.scope(); |
1633 const int num_fixed_params = function.num_fixed_parameters(); | 1634 const int num_fixed_params = function.num_fixed_parameters(); |
1634 const int num_opt_params = function.num_optional_parameters(); | 1635 const int num_opt_params = function.num_optional_parameters(); |
1635 ASSERT(num_fixed_params + num_opt_params <= scope->num_variables()); | 1636 ASSERT(num_fixed_params + num_opt_params <= scope->num_variables()); |
1636 for (int i = 0; i < num_fixed_params + num_opt_params; i++) { | 1637 for (int i = 0; i < num_fixed_params + num_opt_params; i++) { |
1637 LocalVariable* parameter = scope->VariableAt(i); | 1638 LocalVariable* parameter = scope->VariableAt(i); |
1638 GenerateLoadVariable(RAX, *parameter); | 1639 GenerateLoadVariable(RAX, *parameter); |
1639 GenerateAssertAssignable(AstNode::kNoId, | 1640 GenerateAssertAssignable(sequence_node.ParameterIdAt(i), |
1640 parameter->token_index(), | 1641 parameter->token_index(), |
1641 NULL, | 1642 NULL, |
1642 parameter->type(), | 1643 parameter->type(), |
1643 parameter->name()); | 1644 parameter->name()); |
1644 } | 1645 } |
1645 } | 1646 } |
1646 | 1647 |
1647 | 1648 |
1648 void CodeGenerator::GenerateConditionTypeCheck(intptr_t node_id, | 1649 void CodeGenerator::GenerateConditionTypeCheck(intptr_t node_id, |
1649 intptr_t token_index) { | 1650 intptr_t token_index) { |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2724 const Error& error = Error::Handle( | 2725 const Error& error = Error::Handle( |
2725 Parser::FormatError(script, token_index, "Error", format, args)); | 2726 Parser::FormatError(script, token_index, "Error", format, args)); |
2726 va_end(args); | 2727 va_end(args); |
2727 Isolate::Current()->long_jump_base()->Jump(1, error); | 2728 Isolate::Current()->long_jump_base()->Jump(1, error); |
2728 UNREACHABLE(); | 2729 UNREACHABLE(); |
2729 } | 2730 } |
2730 | 2731 |
2731 } // namespace dart | 2732 } // namespace dart |
2732 | 2733 |
2733 #endif // defined TARGET_ARCH_X64 | 2734 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |