| 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 Register result = locs()->out().reg(); | 183 Register result = locs()->out().reg(); |
| 184 | 184 |
| 185 // Check that the type of the value is allowed in conditional context. | 185 // Check that the type of the value is allowed in conditional context. |
| 186 // Call the runtime if the object is not bool::true or bool::false. | 186 // Call the runtime if the object is not bool::true or bool::false. |
| 187 Label done; | 187 Label done; |
| 188 __ CompareObject(obj, compiler->bool_true()); | 188 __ CompareObject(obj, compiler->bool_true()); |
| 189 __ j(EQUAL, &done, Assembler::kNearJump); | 189 __ j(EQUAL, &done, Assembler::kNearJump); |
| 190 __ CompareObject(obj, compiler->bool_false()); | 190 __ CompareObject(obj, compiler->bool_false()); |
| 191 __ j(EQUAL, &done, Assembler::kNearJump); | 191 __ j(EQUAL, &done, Assembler::kNearJump); |
| 192 | 192 |
| 193 __ pushq(Immediate(Smi::RawValue(token_pos()))); // Source location. | |
| 194 __ pushq(obj); // Push the source object. | 193 __ pushq(obj); // Push the source object. |
| 195 compiler->GenerateCallRuntime(cid(), | 194 compiler->GenerateCallRuntime(cid(), |
| 196 token_pos(), | 195 token_pos(), |
| 197 try_index(), | 196 try_index(), |
| 198 kConditionTypeErrorRuntimeEntry); | 197 kConditionTypeErrorRuntimeEntry); |
| 199 // We should never return here. | 198 // We should never return here. |
| 200 __ int3(); | 199 __ int3(); |
| 201 | 200 |
| 202 __ Bind(&done); | 201 __ Bind(&done); |
| 203 ASSERT(obj == result); | 202 ASSERT(obj == result); |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 | 1062 |
| 1064 void AllocateObjectWithBoundsCheckComp::EmitNativeCode( | 1063 void AllocateObjectWithBoundsCheckComp::EmitNativeCode( |
| 1065 FlowGraphCompiler* compiler) { | 1064 FlowGraphCompiler* compiler) { |
| 1066 const Class& cls = Class::ZoneHandle(constructor().owner()); | 1065 const Class& cls = Class::ZoneHandle(constructor().owner()); |
| 1067 Register type_arguments = locs()->in(0).reg(); | 1066 Register type_arguments = locs()->in(0).reg(); |
| 1068 Register instantiator_type_arguments = locs()->in(1).reg(); | 1067 Register instantiator_type_arguments = locs()->in(1).reg(); |
| 1069 Register result = locs()->out().reg(); | 1068 Register result = locs()->out().reg(); |
| 1070 | 1069 |
| 1071 // Push the result place holder initialized to NULL. | 1070 // Push the result place holder initialized to NULL. |
| 1072 __ PushObject(Object::ZoneHandle()); | 1071 __ PushObject(Object::ZoneHandle()); |
| 1073 __ pushq(Immediate(Smi::RawValue(token_pos()))); | |
| 1074 __ PushObject(cls); | 1072 __ PushObject(cls); |
| 1075 __ pushq(type_arguments); | 1073 __ pushq(type_arguments); |
| 1076 __ pushq(instantiator_type_arguments); | 1074 __ pushq(instantiator_type_arguments); |
| 1077 compiler->GenerateCallRuntime(cid(), | 1075 compiler->GenerateCallRuntime(cid(), |
| 1078 token_pos(), | 1076 token_pos(), |
| 1079 try_index(), | 1077 try_index(), |
| 1080 kAllocateObjectWithBoundsCheckRuntimeEntry); | 1078 kAllocateObjectWithBoundsCheckRuntimeEntry); |
| 1081 // Pop instantiator type arguments, type arguments, class, and | 1079 // Pop instantiator type arguments, type arguments, and class. |
| 1082 // source location. | 1080 __ Drop(3); |
| 1083 __ Drop(4); | |
| 1084 __ popq(result); // Pop new instance. | 1081 __ popq(result); // Pop new instance. |
| 1085 } | 1082 } |
| 1086 | 1083 |
| 1087 | 1084 |
| 1088 LocationSummary* LoadVMFieldComp::MakeLocationSummary() const { | 1085 LocationSummary* LoadVMFieldComp::MakeLocationSummary() const { |
| 1089 return LocationSummary::Make(1, Location::RequiresRegister()); | 1086 return LocationSummary::Make(1, Location::RequiresRegister()); |
| 1090 } | 1087 } |
| 1091 | 1088 |
| 1092 | 1089 |
| 1093 void LoadVMFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1090 void LoadVMFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 instance_call()->argument_names()); | 1975 instance_call()->argument_names()); |
| 1979 } | 1976 } |
| 1980 __ Bind(&done); | 1977 __ Bind(&done); |
| 1981 } | 1978 } |
| 1982 | 1979 |
| 1983 } // namespace dart | 1980 } // namespace dart |
| 1984 | 1981 |
| 1985 #undef __ | 1982 #undef __ |
| 1986 | 1983 |
| 1987 #endif // defined TARGET_ARCH_X64 | 1984 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |