| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
| 6 | 6 |
| 7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
| (...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1925 } | 1925 } |
| 1926 | 1926 |
| 1927 code_ = function.CurrentCode(); | 1927 code_ = function.CurrentCode(); |
| 1928 pool_ = code_.object_pool(); | 1928 pool_ = code_.object_pool(); |
| 1929 for (intptr_t i = 0; i < pool_.Length(); i++) { | 1929 for (intptr_t i = 0; i < pool_.Length(); i++) { |
| 1930 if (pool_.InfoAt(i) != ObjectPool::kTaggedObject) continue; | 1930 if (pool_.InfoAt(i) != ObjectPool::kTaggedObject) continue; |
| 1931 entry_ = pool_.ObjectAt(i); | 1931 entry_ = pool_.ObjectAt(i); |
| 1932 if (entry_.IsICData()) { | 1932 if (entry_.IsICData()) { |
| 1933 ic_ ^= entry_.raw(); | 1933 ic_ ^= entry_.raw(); |
| 1934 | 1934 |
| 1935 // Only single check ICs are SwitchableCalls that use the ICLookup | 1935 // SwitchableCalls use single-check ICs. No other kind of IC call is |
| 1936 // stubs. Some operators like + have ICData that check the types of | 1936 // generated in precompilation mode. |
| 1937 // arguments in addition to the receiver and use special stubs | 1937 ASSERT(ic_.NumArgsTested() == 1); |
| 1938 // with fast paths for Smi operations. | |
| 1939 if (ic_.NumArgsTested() != 1) continue; | |
| 1940 | 1938 |
| 1941 for (intptr_t j = 0; j < ic_.NumberOfChecks(); j++) { | 1939 for (intptr_t j = 0; j < ic_.NumberOfChecks(); j++) { |
| 1942 entry_ = ic_.GetTargetOrCodeAt(j); | 1940 entry_ = ic_.GetTargetOrCodeAt(j); |
| 1943 if (entry_.IsFunction()) { | 1941 if (entry_.IsFunction()) { |
| 1944 target_ ^= entry_.raw(); | 1942 target_ ^= entry_.raw(); |
| 1945 ASSERT(target_.HasCode()); | 1943 ASSERT(target_.HasCode()); |
| 1946 target_code_ = target_.CurrentCode(); | 1944 target_code_ = target_.CurrentCode(); |
| 1947 entry_point_ = Smi::FromAlignedAddress(target_code_.EntryPoint()); | 1945 entry_point_ = Smi::FromAlignedAddress(target_code_.EntryPoint()); |
| 1948 ic_.SetCodeAt(j, target_code_); | 1946 ic_.SetCodeAt(j, target_code_); |
| 1949 ic_.SetEntryPointAt(j, entry_point_); | 1947 ic_.SetEntryPointAt(j, entry_point_); |
| (...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2950 CompilationPipeline::New(thread->zone(), function); | 2948 CompilationPipeline::New(thread->zone(), function); |
| 2951 | 2949 |
| 2952 ASSERT(FLAG_precompiled_mode); | 2950 ASSERT(FLAG_precompiled_mode); |
| 2953 const bool optimized = function.IsOptimizable(); // False for natives. | 2951 const bool optimized = function.IsOptimizable(); // False for natives. |
| 2954 return PrecompileFunctionHelper(pipeline, function, optimized); | 2952 return PrecompileFunctionHelper(pipeline, function, optimized); |
| 2955 } | 2953 } |
| 2956 | 2954 |
| 2957 #endif // DART_PRECOMPILER | 2955 #endif // DART_PRECOMPILER |
| 2958 | 2956 |
| 2959 } // namespace dart | 2957 } // namespace dart |
| OLD | NEW |