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

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

Issue 10594002: More ICData cleanups: try to use ICData instead of converting it to another intermediate representa… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 ASSERT(delta >= 0); 182 ASSERT(delta >= 0);
183 BindInstr* context = new BindInstr(new CurrentContextComp()); 183 BindInstr* context = new BindInstr(new CurrentContextComp());
184 AddInstruction(context); 184 AddInstruction(context);
185 Value* context_value = new UseVal(context); 185 Value* context_value = new UseVal(context);
186 while (delta-- > 0) { 186 while (delta-- > 0) {
187 BindInstr* load = new BindInstr(new LoadVMFieldComp( 187 BindInstr* load = new BindInstr(new LoadVMFieldComp(
188 context_value, Context::parent_offset(), Type::ZoneHandle())); 188 context_value, Context::parent_offset(), Type::ZoneHandle()));
189 AddInstruction(load); 189 AddInstruction(load);
190 context_value = new UseVal(load); 190 context_value = new UseVal(load);
191 } 191 }
192 return new LoadVMFieldComp( 192 return new LoadVMFieldComp(context_value,
193 context_value, Context::variable_offset(local.index()), local.type()); 193 Context::variable_offset(local.index()),
194 local.type());
194 } else { 195 } else {
195 return new LoadLocalComp(local, owner()->context_level()); 196 return new LoadLocalComp(local, owner()->context_level());
196 } 197 }
197 } 198 }
198 199
199 200
200 // Stores current context into the 'variable' 201 // Stores current context into the 'variable'
201 void EffectGraphVisitor::BuildStoreContext(const LocalVariable& variable) { 202 void EffectGraphVisitor::BuildStoreContext(const LocalVariable& variable) {
202 BindInstr* context = new BindInstr(new CurrentContextComp()); 203 BindInstr* context = new BindInstr(new CurrentContextComp());
203 AddInstruction(context); 204 AddInstruction(context);
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 ReturnComputation(store); 1894 ReturnComputation(store);
1894 } 1895 }
1895 1896
1896 1897
1897 void EffectGraphVisitor::VisitLoadInstanceFieldNode( 1898 void EffectGraphVisitor::VisitLoadInstanceFieldNode(
1898 LoadInstanceFieldNode* node) { 1899 LoadInstanceFieldNode* node) {
1899 ValueGraphVisitor for_instance(owner(), temp_index()); 1900 ValueGraphVisitor for_instance(owner(), temp_index());
1900 node->instance()->Visit(&for_instance); 1901 node->instance()->Visit(&for_instance);
1901 Append(for_instance); 1902 Append(for_instance);
1902 LoadInstanceFieldComp* load = new LoadInstanceFieldComp( 1903 LoadInstanceFieldComp* load = new LoadInstanceFieldComp(
1903 node->field(), for_instance.value(), NULL, NULL); 1904 node->field(), for_instance.value(), NULL);
1904 ReturnComputation(load); 1905 ReturnComputation(load);
1905 } 1906 }
1906 1907
1907 1908
1908 void EffectGraphVisitor::VisitStoreInstanceFieldNode( 1909 void EffectGraphVisitor::VisitStoreInstanceFieldNode(
1909 StoreInstanceFieldNode* node) { 1910 StoreInstanceFieldNode* node) {
1910 ValueGraphVisitor for_instance(owner(), temp_index()); 1911 ValueGraphVisitor for_instance(owner(), temp_index());
1911 node->instance()->Visit(&for_instance); 1912 node->instance()->Visit(&for_instance);
1912 Append(for_instance); 1913 Append(for_instance);
1913 ValueGraphVisitor for_value(owner(), for_instance.temp_index()); 1914 ValueGraphVisitor for_value(owner(), for_instance.temp_index());
1914 node->value()->Visit(&for_value); 1915 node->value()->Visit(&for_value);
1915 Append(for_value); 1916 Append(for_value);
1916 Value* store_value = for_value.value(); 1917 Value* store_value = for_value.value();
1917 if (FLAG_enable_type_checks) { 1918 if (FLAG_enable_type_checks) {
1918 const AbstractType& type = AbstractType::ZoneHandle(node->field().type()); 1919 const AbstractType& type = AbstractType::ZoneHandle(node->field().type());
1919 const String& dst_name = String::ZoneHandle(node->field().name()); 1920 const String& dst_name = String::ZoneHandle(node->field().name());
1920 store_value = BuildAssignableValue(node->value()->token_index(), 1921 store_value = BuildAssignableValue(node->value()->token_index(),
1921 store_value, 1922 store_value,
1922 type, 1923 type,
1923 dst_name); 1924 dst_name);
1924 } 1925 }
1925 StoreInstanceFieldComp* store = new StoreInstanceFieldComp( 1926 StoreInstanceFieldComp* store = new StoreInstanceFieldComp(
1926 node->field(), for_instance.value(), store_value, NULL, NULL); 1927 node->field(), for_instance.value(), store_value, NULL);
1927 ReturnComputation(store); 1928 ReturnComputation(store);
1928 } 1929 }
1929 1930
1930 1931
1931 // StoreInstanceFieldNode does not return result. 1932 // StoreInstanceFieldNode does not return result.
1932 void ValueGraphVisitor::VisitStoreInstanceFieldNode( 1933 void ValueGraphVisitor::VisitStoreInstanceFieldNode(
1933 StoreInstanceFieldNode* node) { 1934 StoreInstanceFieldNode* node) {
1934 UNIMPLEMENTED(); 1935 UNIMPLEMENTED();
1935 } 1936 }
1936 1937
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
2728 char* chars = reinterpret_cast<char*>( 2729 char* chars = reinterpret_cast<char*>(
2729 Isolate::Current()->current_zone()->Allocate(len)); 2730 Isolate::Current()->current_zone()->Allocate(len));
2730 OS::SNPrint(chars, len, kFormat, function_name, reason); 2731 OS::SNPrint(chars, len, kFormat, function_name, reason);
2731 const Error& error = Error::Handle( 2732 const Error& error = Error::Handle(
2732 LanguageError::New(String::Handle(String::New(chars)))); 2733 LanguageError::New(String::Handle(String::New(chars))));
2733 Isolate::Current()->long_jump_base()->Jump(1, error); 2734 Isolate::Current()->long_jump_base()->Jump(1, error);
2734 } 2735 }
2735 2736
2736 2737
2737 } // namespace dart 2738 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.h » ('j') | runtime/vm/flow_graph_compiler_x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698