| 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/code_descriptors.h" | 8 #include "vm/code_descriptors.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 node->closure()->Visit(&for_closure); | 1863 node->closure()->Visit(&for_closure); |
| 1864 Append(for_closure); | 1864 Append(for_closure); |
| 1865 PushArgumentInstr* push_closure = PushArgument(for_closure.value()); | 1865 PushArgumentInstr* push_closure = PushArgument(for_closure.value()); |
| 1866 | 1866 |
| 1867 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 1867 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 1868 new ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length()); | 1868 new ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length()); |
| 1869 arguments->Add(push_closure); | 1869 arguments->Add(push_closure); |
| 1870 BuildPushArguments(*node->arguments(), arguments); | 1870 BuildPushArguments(*node->arguments(), arguments); |
| 1871 | 1871 |
| 1872 // Save context around the call. | 1872 // Save context around the call. |
| 1873 BuildStoreContext(*owner()->parsed_function().expression_temp_var()); | 1873 BuildStoreContext(*owner()->parsed_function().saved_current_context_var()); |
| 1874 return new ClosureCallInstr(node, arguments); | 1874 return new ClosureCallInstr(node, arguments); |
| 1875 } | 1875 } |
| 1876 | 1876 |
| 1877 | 1877 |
| 1878 void EffectGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) { | 1878 void EffectGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) { |
| 1879 Do(BuildClosureCall(node)); | 1879 Do(BuildClosureCall(node)); |
| 1880 // Restore context from saved location. | 1880 // Restore context from saved location. |
| 1881 BuildLoadContext(*owner()->parsed_function().expression_temp_var()); | 1881 BuildLoadContext(*owner()->parsed_function().saved_current_context_var()); |
| 1882 } | 1882 } |
| 1883 | 1883 |
| 1884 | 1884 |
| 1885 void ValueGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) { | 1885 void ValueGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) { |
| 1886 Value* result = Bind(BuildClosureCall(node)); | 1886 Value* result = Bind(BuildClosureCall(node)); |
| 1887 // Restore context from temp. | 1887 // Restore context from temp. |
| 1888 BuildLoadContext(*owner()->parsed_function().expression_temp_var()); | 1888 BuildLoadContext(*owner()->parsed_function().saved_current_context_var()); |
| 1889 ReturnValue(result); | 1889 ReturnValue(result); |
| 1890 } | 1890 } |
| 1891 | 1891 |
| 1892 | 1892 |
| 1893 void EffectGraphVisitor::VisitCloneContextNode(CloneContextNode* node) { | 1893 void EffectGraphVisitor::VisitCloneContextNode(CloneContextNode* node) { |
| 1894 InlineBailout("EffectGraphVisitor::VisitCloneContextNode (context)"); | 1894 InlineBailout("EffectGraphVisitor::VisitCloneContextNode (context)"); |
| 1895 Value* context = Bind(new CurrentContextInstr()); | 1895 Value* context = Bind(new CurrentContextInstr()); |
| 1896 Value* clone = Bind(new CloneContextInstr(node->token_pos(), context)); | 1896 Value* clone = Bind(new CloneContextInstr(node->token_pos(), context)); |
| 1897 AddInstruction(new StoreContextInstr(clone)); | 1897 AddInstruction(new StoreContextInstr(clone)); |
| 1898 } | 1898 } |
| (...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3229 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3229 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3230 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3230 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3231 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3231 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3232 const Error& error = Error::Handle( | 3232 const Error& error = Error::Handle( |
| 3233 LanguageError::New(String::Handle(String::New(chars)))); | 3233 LanguageError::New(String::Handle(String::New(chars)))); |
| 3234 Isolate::Current()->long_jump_base()->Jump(1, error); | 3234 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3235 } | 3235 } |
| 3236 | 3236 |
| 3237 | 3237 |
| 3238 } // namespace dart | 3238 } // namespace dart |
| OLD | NEW |