| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <array> | 5 #include <array> |
| 6 #include <fstream> | 6 #include <fstream> |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 Bytecode::kLdrNamedProperty}; | 91 Bytecode::kLdrNamedProperty}; |
| 92 case Bytecode::kLdaKeyedProperty: | 92 case Bytecode::kLdaKeyedProperty: |
| 93 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, | 93 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, |
| 94 Bytecode::kLdrKeyedProperty}; | 94 Bytecode::kLdrKeyedProperty}; |
| 95 case Bytecode::kLdaGlobal: | 95 case Bytecode::kLdaGlobal: |
| 96 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, | 96 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, |
| 97 Bytecode::kLdrGlobal}; | 97 Bytecode::kLdrGlobal}; |
| 98 case Bytecode::kLdaContextSlot: | 98 case Bytecode::kLdaContextSlot: |
| 99 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, | 99 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, |
| 100 Bytecode::kLdrContextSlot}; | 100 Bytecode::kLdrContextSlot}; |
| 101 case Bytecode::kLdaCurrentContextSlot: |
| 102 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, |
| 103 Bytecode::kLdrCurrentContextSlot}; |
| 101 case Bytecode::kLdaUndefined: | 104 case Bytecode::kLdaUndefined: |
| 102 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, | 105 return {PeepholeAction::kTransformLdaStarToLdrLdarAction, |
| 103 Bytecode::kLdrUndefined}; | 106 Bytecode::kLdrUndefined}; |
| 104 default: | 107 default: |
| 105 break; | 108 break; |
| 106 } | 109 } |
| 107 } | 110 } |
| 108 | 111 |
| 109 // ToName bytecodes can be replaced by Star with the same output register if | 112 // ToName bytecodes can be replaced by Star with the same output register if |
| 110 // the value in the accumulator is already a name. | 113 // the value in the accumulator is already a name. |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 380 |
| 378 std::ofstream ofs(argv[1], std::ofstream::trunc); | 381 std::ofstream ofs(argv[1], std::ofstream::trunc); |
| 379 v8::internal::interpreter::PeepholeActionTableWriter writer; | 382 v8::internal::interpreter::PeepholeActionTableWriter writer; |
| 380 writer.BuildTable(); | 383 writer.BuildTable(); |
| 381 writer.Write(ofs); | 384 writer.Write(ofs); |
| 382 ofs.flush(); | 385 ofs.flush(); |
| 383 ofs.close(); | 386 ofs.close(); |
| 384 | 387 |
| 385 return 0; | 388 return 0; |
| 386 } | 389 } |
| OLD | NEW |