| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 Register result = locs()->out().reg(); | 175 Register result = locs()->out().reg(); |
| 176 | 176 |
| 177 // Check that the type of the value is allowed in conditional context. | 177 // Check that the type of the value is allowed in conditional context. |
| 178 // Call the runtime if the object is not bool::true or bool::false. | 178 // Call the runtime if the object is not bool::true or bool::false. |
| 179 Label done; | 179 Label done; |
| 180 __ CompareObject(obj, compiler->bool_true()); | 180 __ CompareObject(obj, compiler->bool_true()); |
| 181 __ j(EQUAL, &done, Assembler::kNearJump); | 181 __ j(EQUAL, &done, Assembler::kNearJump); |
| 182 __ CompareObject(obj, compiler->bool_false()); | 182 __ CompareObject(obj, compiler->bool_false()); |
| 183 __ j(EQUAL, &done, Assembler::kNearJump); | 183 __ j(EQUAL, &done, Assembler::kNearJump); |
| 184 | 184 |
| 185 __ pushl(Immediate(Smi::RawValue(token_pos()))); // Source location. | |
| 186 __ pushl(obj); // Push the source object. | 185 __ pushl(obj); // Push the source object. |
| 187 compiler->GenerateCallRuntime(cid(), | 186 compiler->GenerateCallRuntime(cid(), |
| 188 token_pos(), | 187 token_pos(), |
| 189 try_index(), | 188 try_index(), |
| 190 kConditionTypeErrorRuntimeEntry); | 189 kConditionTypeErrorRuntimeEntry); |
| 191 // We should never return here. | 190 // We should never return here. |
| 192 __ int3(); | 191 __ int3(); |
| 193 | 192 |
| 194 __ Bind(&done); | 193 __ Bind(&done); |
| 195 ASSERT(obj == result); | 194 ASSERT(obj == result); |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 | 1053 |
| 1055 void AllocateObjectWithBoundsCheckComp::EmitNativeCode( | 1054 void AllocateObjectWithBoundsCheckComp::EmitNativeCode( |
| 1056 FlowGraphCompiler* compiler) { | 1055 FlowGraphCompiler* compiler) { |
| 1057 const Class& cls = Class::ZoneHandle(constructor().owner()); | 1056 const Class& cls = Class::ZoneHandle(constructor().owner()); |
| 1058 Register type_arguments = locs()->in(0).reg(); | 1057 Register type_arguments = locs()->in(0).reg(); |
| 1059 Register instantiator_type_arguments = locs()->in(1).reg(); | 1058 Register instantiator_type_arguments = locs()->in(1).reg(); |
| 1060 Register result = locs()->out().reg(); | 1059 Register result = locs()->out().reg(); |
| 1061 | 1060 |
| 1062 // Push the result place holder initialized to NULL. | 1061 // Push the result place holder initialized to NULL. |
| 1063 __ PushObject(Object::ZoneHandle()); | 1062 __ PushObject(Object::ZoneHandle()); |
| 1064 __ pushl(Immediate(Smi::RawValue(token_pos()))); | |
| 1065 __ PushObject(cls); | 1063 __ PushObject(cls); |
| 1066 __ pushl(type_arguments); | 1064 __ pushl(type_arguments); |
| 1067 __ pushl(instantiator_type_arguments); | 1065 __ pushl(instantiator_type_arguments); |
| 1068 compiler->GenerateCallRuntime(cid(), | 1066 compiler->GenerateCallRuntime(cid(), |
| 1069 token_pos(), | 1067 token_pos(), |
| 1070 try_index(), | 1068 try_index(), |
| 1071 kAllocateObjectWithBoundsCheckRuntimeEntry); | 1069 kAllocateObjectWithBoundsCheckRuntimeEntry); |
| 1072 // Pop instantiator type arguments, type arguments, class, and | 1070 // Pop instantiator type arguments, type arguments, and class. |
| 1073 // source location. | 1071 // source location. |
| 1074 __ Drop(4); | 1072 __ Drop(3); |
| 1075 __ popl(result); // Pop new instance. | 1073 __ popl(result); // Pop new instance. |
| 1076 } | 1074 } |
| 1077 | 1075 |
| 1078 | 1076 |
| 1079 LocationSummary* LoadVMFieldComp::MakeLocationSummary() const { | 1077 LocationSummary* LoadVMFieldComp::MakeLocationSummary() const { |
| 1080 return LocationSummary::Make(1, Location::RequiresRegister()); | 1078 return LocationSummary::Make(1, Location::RequiresRegister()); |
| 1081 } | 1079 } |
| 1082 | 1080 |
| 1083 | 1081 |
| 1084 void LoadVMFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1082 void LoadVMFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 instance_call()->argument_names()); | 1971 instance_call()->argument_names()); |
| 1974 } | 1972 } |
| 1975 __ Bind(&done); | 1973 __ Bind(&done); |
| 1976 } | 1974 } |
| 1977 | 1975 |
| 1978 } // namespace dart | 1976 } // namespace dart |
| 1979 | 1977 |
| 1980 #undef __ | 1978 #undef __ |
| 1981 | 1979 |
| 1982 #endif // defined TARGET_ARCH_X64 | 1980 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |