| 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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 LoadValue(RAX, comp->value()); | 1030 LoadValue(RAX, comp->value()); |
| 1031 GenerateInstanceOf(comp->cid(), | 1031 GenerateInstanceOf(comp->cid(), |
| 1032 comp->token_index(), | 1032 comp->token_index(), |
| 1033 comp->try_index(), | 1033 comp->try_index(), |
| 1034 comp->type(), | 1034 comp->type(), |
| 1035 comp->negate_result()); | 1035 comp->negate_result()); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 | 1038 |
| 1039 void FlowGraphCompiler::VisitAllocateObject(AllocateObjectComp* comp) { | 1039 void FlowGraphCompiler::VisitAllocateObject(AllocateObjectComp* comp) { |
| 1040 const Class& cls = Class::ZoneHandle(comp->constructor().owner()); | 1040 // Moved to intermediate_language_x64.cc. |
| 1041 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls)); | 1041 UNREACHABLE(); |
| 1042 const ExternalLabel label(cls.ToCString(), stub.EntryPoint()); | |
| 1043 GenerateCall(comp->token_index(), comp->try_index(), &label, | |
| 1044 PcDescriptors::kOther); | |
| 1045 __ Drop(comp->arguments().length()); // Discard allocation argument. | |
| 1046 } | 1042 } |
| 1047 | 1043 |
| 1048 | 1044 |
| 1049 void FlowGraphCompiler::VisitAllocateObjectWithBoundsCheck( | 1045 void FlowGraphCompiler::VisitAllocateObjectWithBoundsCheck( |
| 1050 AllocateObjectWithBoundsCheckComp* comp) { | 1046 AllocateObjectWithBoundsCheckComp* comp) { |
| 1051 const Class& cls = Class::ZoneHandle(comp->constructor().owner()); | 1047 // Moved to intermediate_language_x64.cc. |
| 1052 __ popq(RCX); // Pop instantiator type arguments. | 1048 UNREACHABLE(); |
| 1053 __ popq(RAX); // Pop type arguments. | |
| 1054 | |
| 1055 // Push the result place holder initialized to NULL. | |
| 1056 __ PushObject(Object::ZoneHandle()); | |
| 1057 __ pushq(Immediate(Smi::RawValue(comp->token_index()))); | |
| 1058 __ PushObject(cls); | |
| 1059 __ pushq(RAX); // Push type arguments. | |
| 1060 __ pushq(RCX); // Push instantiator type arguments. | |
| 1061 GenerateCallRuntime(comp->cid(), | |
| 1062 comp->token_index(), | |
| 1063 comp->try_index(), | |
| 1064 kAllocateObjectWithBoundsCheckRuntimeEntry); | |
| 1065 // Pop instantiator type arguments, type arguments, class, and | |
| 1066 // source location. | |
| 1067 __ Drop(4); | |
| 1068 __ popq(RAX); // Pop new instance. | |
| 1069 } | 1049 } |
| 1070 | 1050 |
| 1071 | 1051 |
| 1072 void FlowGraphCompiler::VisitCreateArray(CreateArrayComp* comp) { | 1052 void FlowGraphCompiler::VisitCreateArray(CreateArrayComp* comp) { |
| 1073 // 1. Allocate the array. R10 = length, RBX = element type. | 1053 // 1. Allocate the array. R10 = length, RBX = element type. |
| 1074 __ movq(R10, Immediate(Smi::RawValue(comp->ElementCount()))); | 1054 __ movq(R10, Immediate(Smi::RawValue(comp->ElementCount()))); |
| 1075 LoadValue(RBX, comp->element_type()); | 1055 LoadValue(RBX, comp->element_type()); |
| 1076 GenerateCall(comp->token_index(), | 1056 GenerateCall(comp->token_index(), |
| 1077 comp->try_index(), | 1057 comp->try_index(), |
| 1078 &StubCode::AllocateArrayLabel(), | 1058 &StubCode::AllocateArrayLabel(), |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 | 1911 |
| 1932 | 1912 |
| 1933 void FlowGraphCompiler::FinalizeComments(const Code& code) { | 1913 void FlowGraphCompiler::FinalizeComments(const Code& code) { |
| 1934 code.set_comments(assembler_->GetCodeComments()); | 1914 code.set_comments(assembler_->GetCodeComments()); |
| 1935 } | 1915 } |
| 1936 | 1916 |
| 1937 | 1917 |
| 1938 } // namespace dart | 1918 } // namespace dart |
| 1939 | 1919 |
| 1940 #endif // defined TARGET_ARCH_X64 | 1920 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |