Chromium Code Reviews| 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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "vm/ast_printer.h" | 7 #include "vm/ast_printer.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2629 } | 2629 } |
| 2630 } | 2630 } |
| 2631 | 2631 |
| 2632 // 2. Process normal instructions. | 2632 // 2. Process normal instructions. |
| 2633 for (ForwardInstructionIterator it(block_entry); !it.Done(); it.Advance()) { | 2633 for (ForwardInstructionIterator it(block_entry); !it.Done(); it.Advance()) { |
| 2634 Instruction* current = it.Current(); | 2634 Instruction* current = it.Current(); |
| 2635 // Attach current environment to the instruction. | 2635 // Attach current environment to the instruction. |
| 2636 // TODO(fschneider): Currently each instruction gets a full copy of the | 2636 // TODO(fschneider): Currently each instruction gets a full copy of the |
| 2637 // environment. This should be optimized: Only instructions that can | 2637 // environment. This should be optimized: Only instructions that can |
| 2638 // deoptimize should have uses of the environment values. | 2638 // deoptimize should have uses of the environment values. |
| 2639 current->set_env(new Environment(*env, fixed_parameter_count)); | 2639 if (!current->IsReturn()) { |
|
Florian Schneider
2012/07/31 15:31:59
This is not part of the fix. I'd remove it.
Vyacheslav Egorov (Google)
2012/07/31 16:18:49
Done.
| |
| 2640 current->set_env(new Environment(*env, fixed_parameter_count)); | |
| 2641 } | |
| 2640 | 2642 |
| 2641 // 2a. Handle uses: | 2643 // 2a. Handle uses: |
| 2642 // Update expression stack environment for each use. | 2644 // Update expression stack environment for each use. |
| 2643 // For each use of a LoadLocal or StoreLocal: Replace it with the value | 2645 // For each use of a LoadLocal or StoreLocal: Replace it with the value |
| 2644 // from the environment. | 2646 // from the environment. |
| 2645 for (intptr_t i = 0; i < current->InputCount(); ++i) { | 2647 for (intptr_t i = 0; i < current->InputCount(); ++i) { |
| 2646 Value* v = current->InputAt(i); | 2648 Value* v = current->InputAt(i); |
| 2647 if (!v->IsUse()) continue; | 2649 if (!v->IsUse()) continue; |
| 2648 // Update expression stack. | 2650 // Update expression stack. |
| 2649 ASSERT(env->length() > var_count); | 2651 ASSERT(env->length() > var_count); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2750 char* chars = reinterpret_cast<char*>( | 2752 char* chars = reinterpret_cast<char*>( |
| 2751 Isolate::Current()->current_zone()->Allocate(len)); | 2753 Isolate::Current()->current_zone()->Allocate(len)); |
| 2752 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2754 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2753 const Error& error = Error::Handle( | 2755 const Error& error = Error::Handle( |
| 2754 LanguageError::New(String::Handle(String::New(chars)))); | 2756 LanguageError::New(String::Handle(String::New(chars)))); |
| 2755 Isolate::Current()->long_jump_base()->Jump(1, error); | 2757 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2756 } | 2758 } |
| 2757 | 2759 |
| 2758 | 2760 |
| 2759 } // namespace dart | 2761 } // namespace dart |
| OLD | NEW |