| 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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 if (local_count > 0) { | 921 if (local_count > 0) { |
| 922 __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(Object::null()))); | 922 __ movq(RAX, Immediate(reinterpret_cast<intptr_t>(Object::null()))); |
| 923 const int base = parsed_function().first_stack_local_index(); | 923 const int base = parsed_function().first_stack_local_index(); |
| 924 for (int i = 0; i < local_count; ++i) { | 924 for (int i = 0; i < local_count; ++i) { |
| 925 // Subtract index i (locals lie at lower addresses than RBP). | 925 // Subtract index i (locals lie at lower addresses than RBP). |
| 926 __ movq(Address(RBP, (base - i) * kWordSize), RAX); | 926 __ movq(Address(RBP, (base - i) * kWordSize), RAX); |
| 927 } | 927 } |
| 928 } | 928 } |
| 929 | 929 |
| 930 // Generate stack overflow check. | 930 // Generate stack overflow check. |
| 931 __ movq(TMP, Immediate(Isolate::Current()->stack_limit_address())); | 931 __ movq(RDI, Immediate(Isolate::Current()->stack_limit_address())); |
| 932 __ cmpq(RSP, Address(TMP, 0)); | 932 __ cmpq(RSP, Address(RDI, 0)); |
| 933 Label no_stack_overflow; | 933 Label no_stack_overflow; |
| 934 __ j(ABOVE, &no_stack_overflow, Assembler::kNearJump); | 934 __ j(ABOVE, &no_stack_overflow, Assembler::kNearJump); |
| 935 GenerateCallRuntime(AstNode::kNoId, | 935 GenerateCallRuntime(AstNode::kNoId, |
| 936 function.token_index(), | 936 function.token_index(), |
| 937 CatchClauseNode::kInvalidTryIndex, | 937 CatchClauseNode::kInvalidTryIndex, |
| 938 kStackOverflowRuntimeEntry); | 938 kStackOverflowRuntimeEntry); |
| 939 __ Bind(&no_stack_overflow); | 939 __ Bind(&no_stack_overflow); |
| 940 | 940 |
| 941 if (FLAG_print_scopes) { | 941 if (FLAG_print_scopes) { |
| 942 // Print the function scope (again) after generating the prologue in order | 942 // Print the function scope (again) after generating the prologue in order |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 __ cvtsi2sd(result, temp); | 1029 __ cvtsi2sd(result, temp); |
| 1030 __ Bind(&done); | 1030 __ Bind(&done); |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 | 1033 |
| 1034 #undef __ | 1034 #undef __ |
| 1035 | 1035 |
| 1036 } // namespace dart | 1036 } // namespace dart |
| 1037 | 1037 |
| 1038 #endif // defined TARGET_ARCH_X64 | 1038 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |