| OLD | NEW |
| 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/opt_code_generator.h" | 8 #include "vm/opt_code_generator.h" |
| 9 | 9 |
| 10 #include "vm/assembler_macros.h" | 10 #include "vm/assembler_macros.h" |
| (...skipping 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 node->arguments()->names())); | 2547 node->arguments()->names())); |
| 2548 GenerateCall(node->token_index(), &StubCode::CallStaticFunctionLabel()); | 2548 GenerateCall(node->token_index(), &StubCode::CallStaticFunctionLabel()); |
| 2549 } | 2549 } |
| 2550 __ addl(ESP, Immediate(node->arguments()->length() * kWordSize)); | 2550 __ addl(ESP, Immediate(node->arguments()->length() * kWordSize)); |
| 2551 // Result is in EAX. | 2551 // Result is in EAX. |
| 2552 if (IsResultNeeded(node)) { | 2552 if (IsResultNeeded(node)) { |
| 2553 __ pushl(EAX); | 2553 __ pushl(EAX); |
| 2554 } | 2554 } |
| 2555 } | 2555 } |
| 2556 | 2556 |
| 2557 |
| 2558 void OptimizingCodeGenerator::VisitReturnNode(ReturnNode* node) { |
| 2559 if ((node->inlined_finally_list_length() > 0) || FLAG_enable_type_checks) { |
| 2560 CodeGenerator::VisitReturnNode(node); |
| 2561 return; |
| 2562 } |
| 2563 ASSERT(!IsResultNeeded(node)); |
| 2564 ASSERT(node->value() != NULL); |
| 2565 VisitLoadOne(node->value(), EAX); |
| 2566 GenerateReturnEpilog(); |
| 2567 } |
| 2568 |
| 2569 |
| 2570 void OptimizingCodeGenerator::VisitSequenceNode(SequenceNode* node_sequence) { |
| 2571 if (FLAG_enable_type_checks || |
| 2572 (node_sequence->scope()->num_context_variables() > 0)) { |
| 2573 CodeGenerator::VisitSequenceNode(node_sequence); |
| 2574 return; |
| 2575 } |
| 2576 for (int i = 0; i < node_sequence->length(); i++) { |
| 2577 AstNode* child_node = node_sequence->NodeAt(i); |
| 2578 state()->set_root_node(child_node); |
| 2579 child_node->Visit(this); |
| 2580 } |
| 2581 if (node_sequence->label() != NULL) { |
| 2582 __ Bind(node_sequence->label()->break_label()); |
| 2583 } |
| 2584 } |
| 2585 |
| 2586 |
| 2587 void OptimizingCodeGenerator::VisitStoreInstanceFieldNode( |
| 2588 StoreInstanceFieldNode* node) { |
| 2589 if (FLAG_enable_type_checks) { |
| 2590 CodeGenerator::VisitStoreInstanceFieldNode(node); |
| 2591 return; |
| 2592 } |
| 2593 VisitLoadTwo(node->instance(), node->value(), EDX, EAX); |
| 2594 __ StoreIntoObject(EDX, FieldAddress(EDX, node->field().Offset()), EAX); |
| 2595 if (IsResultNeeded(node)) { |
| 2596 // The result is the input value. |
| 2597 __ pushl(EAX); |
| 2598 } |
| 2599 } |
| 2600 |
| 2601 |
| 2557 } // namespace dart | 2602 } // namespace dart |
| 2558 | 2603 |
| 2559 #endif // defined TARGET_ARCH_IA32 | 2604 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |