| 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/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 operator_name, | 1172 operator_name, |
| 1173 kNumberOfArguments, | 1173 kNumberOfArguments, |
| 1174 kNoArgumentNames, | 1174 kNoArgumentNames, |
| 1175 kNumArgumentsChecked); | 1175 kNumArgumentsChecked); |
| 1176 if (IsResultNeeded(node)) { | 1176 if (IsResultNeeded(node)) { |
| 1177 __ pushl(EAX); | 1177 __ pushl(EAX); |
| 1178 } | 1178 } |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 | 1181 |
| 1182 void CodeGenerator::VisitIncrOpLocalNode(IncrOpLocalNode* node) { | |
| 1183 ASSERT((node->kind() == Token::kINCR) || (node->kind() == Token::kDECR)); | |
| 1184 MarkDeoptPoint(node->id(), node->token_index()); | |
| 1185 GenerateLoadVariable(EAX, node->local()); | |
| 1186 if (!node->prefix() && IsResultNeeded(node)) { | |
| 1187 // Preserve as result. | |
| 1188 __ pushl(EAX); | |
| 1189 } | |
| 1190 const char* operator_name = (node->kind() == Token::kINCR) ? "+" : "-"; | |
| 1191 __ pushl(EAX); | |
| 1192 __ pushl(Immediate(Smi::RawValue(1))); | |
| 1193 GenerateBinaryOperatorCall(node->id(), node->token_index(), operator_name); | |
| 1194 // result is in EAX. | |
| 1195 if (FLAG_enable_type_checks) { | |
| 1196 GenerateAssertAssignable(node->id(), | |
| 1197 node->token_index(), | |
| 1198 NULL, | |
| 1199 node->local().type(), | |
| 1200 node->local().name()); | |
| 1201 } | |
| 1202 GenerateStoreVariable(node->local(), EAX, EDX); | |
| 1203 if (node->prefix() && IsResultNeeded(node)) { | |
| 1204 __ pushl(EAX); | |
| 1205 } | |
| 1206 } | |
| 1207 | |
| 1208 | |
| 1209 void CodeGenerator::VisitIncrOpInstanceFieldNode( | 1182 void CodeGenerator::VisitIncrOpInstanceFieldNode( |
| 1210 IncrOpInstanceFieldNode* node) { | 1183 IncrOpInstanceFieldNode* node) { |
| 1211 ASSERT((node->kind() == Token::kINCR) || (node->kind() == Token::kDECR)); | 1184 ASSERT((node->kind() == Token::kINCR) || (node->kind() == Token::kDECR)); |
| 1212 node->receiver()->Visit(this); | 1185 node->receiver()->Visit(this); |
| 1213 __ pushl(Address(ESP, 0)); // Duplicate receiver (preserve for setter). | 1186 __ pushl(Address(ESP, 0)); // Duplicate receiver (preserve for setter). |
| 1214 MarkDeoptPoint(node->getter_id(), node->token_index()); | 1187 MarkDeoptPoint(node->getter_id(), node->token_index()); |
| 1215 GenerateInstanceGetterCall(node->getter_id(), | 1188 GenerateInstanceGetterCall(node->getter_id(), |
| 1216 node->token_index(), | 1189 node->token_index(), |
| 1217 node->field_name()); | 1190 node->field_name()); |
| 1218 // result is in EAX. | 1191 // result is in EAX. |
| (...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2992 const Error& error = Error::Handle( | 2965 const Error& error = Error::Handle( |
| 2993 Parser::FormatError(script, token_index, "Error", format, args)); | 2966 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2994 va_end(args); | 2967 va_end(args); |
| 2995 Isolate::Current()->long_jump_base()->Jump(1, error); | 2968 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2996 UNREACHABLE(); | 2969 UNREACHABLE(); |
| 2997 } | 2970 } |
| 2998 | 2971 |
| 2999 } // namespace dart | 2972 } // namespace dart |
| 3000 | 2973 |
| 3001 #endif // defined TARGET_ARCH_IA32 | 2974 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |