Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1035)

Side by Side Diff: runtime/vm/code_generator_ia32.cc

Issue 8972005: More optimizations cleanup. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/opt_code_generator_ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 intptr_t token_index, 426 intptr_t token_index,
427 const String& function_name, 427 const String& function_name,
428 int num_arguments, 428 int num_arguments,
429 const Array& optional_arguments_names, 429 const Array& optional_arguments_names,
430 intptr_t num_args_checked) { 430 intptr_t num_args_checked) {
431 ASSERT(num_args_checked > 0); // At least receiver check is necessary. 431 ASSERT(num_args_checked > 0); // At least receiver check is necessary.
432 // Set up the function name and number of arguments (including the receiver) 432 // Set up the function name and number of arguments (including the receiver)
433 // to the InstanceCall stub which will resolve the correct entrypoint for 433 // to the InstanceCall stub which will resolve the correct entrypoint for
434 // the operator and call it. 434 // the operator and call it.
435 ICData ic_data(function_name, num_args_checked); 435 ICData ic_data(function_name, num_args_checked);
436 ASSERT(ic_data.NumberOfArgumentsChecked() == num_args_checked);
436 __ LoadObject(ECX, Array::ZoneHandle(ic_data.data())); 437 __ LoadObject(ECX, Array::ZoneHandle(ic_data.data()));
437 __ LoadObject(EDX, ArgumentsDescriptor(num_arguments, 438 __ LoadObject(EDX, ArgumentsDescriptor(num_arguments,
438 optional_arguments_names)); 439 optional_arguments_names));
439 uword label_address = 0; 440 uword label_address = 0;
440 switch (num_args_checked) { 441 switch (num_args_checked) {
441 case 1: 442 case 1:
442 label_address = StubCode::OneArgCheckInlineCacheEntryPoint(); 443 label_address = StubCode::OneArgCheckInlineCacheEntryPoint();
443 break; 444 break;
444 case 2: 445 case 2:
445 label_address = StubCode::TwoArgsCheckInlineCacheEntryPoint(); 446 label_address = StubCode::TwoArgsCheckInlineCacheEntryPoint();
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 1192
1192 1193
1193 void CodeGenerator::VisitUnaryOpNode(UnaryOpNode* node) { 1194 void CodeGenerator::VisitUnaryOpNode(UnaryOpNode* node) {
1194 if (node->kind() == Token::kNOT) { 1195 if (node->kind() == Token::kNOT) {
1195 // "!" cannot be overloaded, therefore inline it. 1196 // "!" cannot be overloaded, therefore inline it.
1196 GenerateLogicalNotOp(node); 1197 GenerateLogicalNotOp(node);
1197 return; 1198 return;
1198 } 1199 }
1199 node->operand()->Visit(this); 1200 node->operand()->Visit(this);
1200 if (node->kind() == Token::kADD) { 1201 if (node->kind() == Token::kADD) {
1202 // TODO(srdjan): Remove this as it is not part of Dart language any longer.
1201 // Unary operator '+' does not exist, it's a NOP, skip it. 1203 // Unary operator '+' does not exist, it's a NOP, skip it.
1202 if (!IsResultNeeded(node)) { 1204 if (!IsResultNeeded(node)) {
1203 __ popl(EAX); 1205 __ popl(EAX);
1204 } 1206 }
1205 return; 1207 return;
1206 } 1208 }
1207 MarkDeoptPoint(node->id(), node->token_index()); 1209 MarkDeoptPoint(node->id(), node->token_index());
1208 String& operator_name = String::ZoneHandle(); 1210 String& operator_name = String::ZoneHandle();
1209 if (node->kind() == Token::kSUB) { 1211 if (node->kind() == Token::kSUB) {
1210 operator_name = String::NewSymbol(Token::Str(Token::kNEGATE)); 1212 operator_name = String::NewSymbol(Token::Str(Token::kNEGATE));
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
2782 message_buffer, kMessageBufferSize, 2784 message_buffer, kMessageBufferSize,
2783 format, args); 2785 format, args);
2784 va_end(args); 2786 va_end(args);
2785 Isolate::Current()->long_jump_base()->Jump(1, message_buffer); 2787 Isolate::Current()->long_jump_base()->Jump(1, message_buffer);
2786 UNREACHABLE(); 2788 UNREACHABLE();
2787 } 2789 }
2788 2790
2789 } // namespace dart 2791 } // namespace dart
2790 2792
2791 #endif // defined TARGET_ARCH_IA32 2793 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/opt_code_generator_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698