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

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

Issue 2272793004: Update some switchable call stub names and comments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 3 months 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/stub_code.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) 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 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 } 1898 }
1899 1899
1900 1900
1901 void Precompiler::SwitchICCalls() { 1901 void Precompiler::SwitchICCalls() {
1902 #if !defined(TARGET_ARCH_DBC) 1902 #if !defined(TARGET_ARCH_DBC)
1903 // Now that all functions have been compiled, we can switch to an instance 1903 // Now that all functions have been compiled, we can switch to an instance
1904 // call sequence that loads the Code object and entry point directly from 1904 // call sequence that loads the Code object and entry point directly from
1905 // the ic data array instead indirectly through a Function in the ic data 1905 // the ic data array instead indirectly through a Function in the ic data
1906 // array. Iterate all the object pools and rewrite the ic data from 1906 // array. Iterate all the object pools and rewrite the ic data from
1907 // (cid, target function, count) to (cid, target code, entry point), and 1907 // (cid, target function, count) to (cid, target code, entry point), and
1908 // replace the ICLookupThroughFunction stub with ICLookupThroughCode. 1908 // replace the ICCallThroughFunction stub with ICCallThroughCode.
1909 1909
1910 class SwitchICCallsVisitor : public FunctionVisitor { 1910 class SwitchICCallsVisitor : public FunctionVisitor {
1911 public: 1911 public:
1912 explicit SwitchICCallsVisitor(Zone* zone) : 1912 explicit SwitchICCallsVisitor(Zone* zone) :
1913 zone_(zone), 1913 zone_(zone),
1914 code_(Code::Handle(zone)), 1914 code_(Code::Handle(zone)),
1915 pool_(ObjectPool::Handle(zone)), 1915 pool_(ObjectPool::Handle(zone)),
1916 entry_(Object::Handle(zone)), 1916 entry_(Object::Handle(zone)),
1917 ic_(ICData::Handle(zone)), 1917 ic_(ICData::Handle(zone)),
1918 target_code_(Code::Handle(zone)) { 1918 target_code_(Code::Handle(zone)) {
1919 } 1919 }
1920 1920
1921 void Visit(const Function& function) { 1921 void Visit(const Function& function) {
1922 if (!function.HasCode()) { 1922 if (!function.HasCode()) {
1923 return; 1923 return;
1924 } 1924 }
1925 1925
1926 code_ = function.CurrentCode(); 1926 code_ = function.CurrentCode();
1927 pool_ = code_.object_pool(); 1927 pool_ = code_.object_pool();
1928 for (intptr_t i = 0; i < pool_.Length(); i++) { 1928 for (intptr_t i = 0; i < pool_.Length(); i++) {
1929 if (pool_.InfoAt(i) != ObjectPool::kTaggedObject) continue; 1929 if (pool_.InfoAt(i) != ObjectPool::kTaggedObject) continue;
1930 entry_ = pool_.ObjectAt(i); 1930 entry_ = pool_.ObjectAt(i);
1931 if (entry_.IsICData()) { 1931 if (entry_.IsICData()) {
1932 // The only IC calls generated by precompilation are for switchable 1932 // The only IC calls generated by precompilation are for switchable
1933 // calls. 1933 // calls.
1934 ic_ ^= entry_.raw(); 1934 ic_ ^= entry_.raw();
1935 ic_.ResetSwitchable(zone_); 1935 ic_.ResetSwitchable(zone_);
1936 } else if (entry_.raw() == 1936 } else if (entry_.raw() ==
1937 StubCode::ICLookupThroughFunction_entry()->code()) { 1937 StubCode::ICCallThroughFunction_entry()->code()) {
1938 target_code_ = StubCode::ICLookupThroughCode_entry()->code(); 1938 target_code_ = StubCode::ICCallThroughCode_entry()->code();
1939 pool_.SetObjectAt(i, target_code_); 1939 pool_.SetObjectAt(i, target_code_);
1940 } 1940 }
1941 } 1941 }
1942 } 1942 }
1943 1943
1944 private: 1944 private:
1945 Zone* zone_; 1945 Zone* zone_;
1946 Code& code_; 1946 Code& code_;
1947 ObjectPool& pool_; 1947 ObjectPool& pool_;
1948 Object& entry_; 1948 Object& entry_;
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
2930 CompilationPipeline::New(thread->zone(), function); 2930 CompilationPipeline::New(thread->zone(), function);
2931 2931
2932 ASSERT(FLAG_precompiled_mode); 2932 ASSERT(FLAG_precompiled_mode);
2933 const bool optimized = function.IsOptimizable(); // False for natives. 2933 const bool optimized = function.IsOptimizable(); // False for natives.
2934 return PrecompileFunctionHelper(pipeline, function, optimized); 2934 return PrecompileFunctionHelper(pipeline, function, optimized);
2935 } 2935 }
2936 2936
2937 #endif // DART_PRECOMPILER 2937 #endif // DART_PRECOMPILER
2938 2938
2939 } // namespace dart 2939 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698