| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 6319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6330 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6330 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6331 // Arguments descriptor is expected in R10. | 6331 // Arguments descriptor is expected in R10. |
| 6332 intptr_t argument_count = ArgumentCount(); | 6332 intptr_t argument_count = ArgumentCount(); |
| 6333 const Array& arguments_descriptor = | 6333 const Array& arguments_descriptor = |
| 6334 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, | 6334 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, |
| 6335 argument_names())); | 6335 argument_names())); |
| 6336 __ LoadObject(R10, arguments_descriptor); | 6336 __ LoadObject(R10, arguments_descriptor); |
| 6337 | 6337 |
| 6338 // Function in RAX. | 6338 // Function in RAX. |
| 6339 ASSERT(locs()->in(0).reg() == RAX); | 6339 ASSERT(locs()->in(0).reg() == RAX); |
| 6340 __ movq(RCX, FieldAddress(RAX, Function::instructions_offset())); | 6340 __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset())); |
| 6341 | 6341 |
| 6342 // RAX: Function. | 6342 // RAX: Function. |
| 6343 // R10: Arguments descriptor array. | 6343 // R10: Arguments descriptor array. |
| 6344 // RBX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 6344 // RBX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
| 6345 __ xorq(RBX, RBX); | 6345 __ xorq(RBX, RBX); |
| 6346 __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | |
| 6347 __ call(RCX); | 6346 __ call(RCX); |
| 6348 compiler->RecordSafepoint(locs()); | 6347 compiler->RecordSafepoint(locs()); |
| 6349 // Marks either the continuation point in unoptimized code or the | 6348 // Marks either the continuation point in unoptimized code or the |
| 6350 // deoptimization point in optimized code, after call. | 6349 // deoptimization point in optimized code, after call. |
| 6351 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); | 6350 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); |
| 6352 if (compiler->is_optimizing()) { | 6351 if (compiler->is_optimizing()) { |
| 6353 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); | 6352 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); |
| 6354 } | 6353 } |
| 6355 // Add deoptimization continuation point after the call and before the | 6354 // Add deoptimization continuation point after the call and before the |
| 6356 // arguments are removed. | 6355 // arguments are removed. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6437 __ Drop(1); | 6436 __ Drop(1); |
| 6438 __ popq(result); | 6437 __ popq(result); |
| 6439 } | 6438 } |
| 6440 | 6439 |
| 6441 | 6440 |
| 6442 } // namespace dart | 6441 } // namespace dart |
| 6443 | 6442 |
| 6444 #undef __ | 6443 #undef __ |
| 6445 | 6444 |
| 6446 #endif // defined TARGET_ARCH_X64 | 6445 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |