| 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 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 delete[] opt_param_position; | 1229 delete[] opt_param_position; |
| 1230 // Check that RDI now points to the null terminator in the array descriptor. | 1230 // Check that RDI now points to the null terminator in the array descriptor. |
| 1231 const Immediate raw_null = | 1231 const Immediate raw_null = |
| 1232 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1232 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 1233 Label all_arguments_processed; | 1233 Label all_arguments_processed; |
| 1234 __ cmpq(Address(RDI, 0), raw_null); | 1234 __ cmpq(Address(RDI, 0), raw_null); |
| 1235 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump); | 1235 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump); |
| 1236 | 1236 |
| 1237 __ Bind(&wrong_num_arguments); | 1237 __ Bind(&wrong_num_arguments); |
| 1238 if (StackSize() != 0) { | 1238 if (StackSize() != 0) { |
| 1239 // We need to unwind the space we reserved for locals and copied parmeters. | 1239 // We need to unwind the space we reserved for locals and copied parameters. |
| 1240 // The NoSuchMethodFunction stub does not expect to see that area on the | 1240 // The NoSuchMethodFunction stub does not expect to see that area on the |
| 1241 // stack. | 1241 // stack. |
| 1242 __ addq(RSP, Immediate(StackSize() * kWordSize)); | 1242 __ addq(RSP, Immediate(StackSize() * kWordSize)); |
| 1243 } | 1243 } |
| 1244 if (function.IsClosureFunction()) { | 1244 if (function.IsClosureFunction()) { |
| 1245 GenerateCallRuntime(AstNode::kNoId, | 1245 GenerateCallRuntime(AstNode::kNoId, |
| 1246 0, | 1246 0, |
| 1247 CatchClauseNode::kInvalidTryIndex, | 1247 CatchClauseNode::kInvalidTryIndex, |
| 1248 kClosureArgumentMismatchRuntimeEntry); | 1248 kClosureArgumentMismatchRuntimeEntry); |
| 1249 } else { | 1249 } else { |
| 1250 // Invoke noSuchMethod function. | 1250 // Invoke noSuchMethod function. |
| 1251 const int kNumArgsChecked = 1; | 1251 const int kNumArgsChecked = 1; |
| 1252 ICData& ic_data = ICData::ZoneHandle(); | 1252 ICData& ic_data = ICData::ZoneHandle(); |
| 1253 ic_data = ICData::New(parsed_function_.function(), | 1253 ic_data = ICData::New(function, |
| 1254 String::Handle(function.name()), | 1254 String::Handle(function.name()), |
| 1255 AstNode::kNoId, | 1255 AstNode::kNoId, |
| 1256 kNumArgsChecked); | 1256 kNumArgsChecked); |
| 1257 __ LoadObject(RBX, ic_data); | 1257 __ LoadObject(RBX, ic_data); |
| 1258 // RBP - 8 : PC marker, allows easy identification of RawInstruction obj. | 1258 // RBP - 8 : PC marker, allows easy identification of RawInstruction obj. |
| 1259 // RBP : points to previous frame pointer. | 1259 // RBP : points to previous frame pointer. |
| 1260 // RBP + 8 : points to return address. | 1260 // RBP + 8 : points to return address. |
| 1261 // RBP + 16 : address of last argument (arg n-1). | 1261 // RBP + 16 : address of last argument (arg n-1). |
| 1262 // RSP + 16 + 8*(n-1) : address of first argument (arg 0). | 1262 // RSP + 16 + 8*(n-1) : address of first argument (arg 0). |
| 1263 // RBX : ic-data. | 1263 // RBX : ic-data. |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1558 | 1558 |
| 1559 void FlowGraphCompiler::FinalizeComments(const Code& code) { | 1559 void FlowGraphCompiler::FinalizeComments(const Code& code) { |
| 1560 code.set_comments(assembler_->GetCodeComments()); | 1560 code.set_comments(assembler_->GetCodeComments()); |
| 1561 } | 1561 } |
| 1562 | 1562 |
| 1563 #undef __ | 1563 #undef __ |
| 1564 | 1564 |
| 1565 } // namespace dart | 1565 } // namespace dart |
| 1566 | 1566 |
| 1567 #endif // defined TARGET_ARCH_X64 | 1567 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |