| 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 "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 2374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2385 node->function_name(), | 2385 node->function_name(), |
| 2386 Token::kILLEGAL, | 2386 Token::kILLEGAL, |
| 2387 arguments, | 2387 arguments, |
| 2388 node->arguments()->names(), | 2388 node->arguments()->names(), |
| 2389 1, | 2389 1, |
| 2390 owner()->ic_data_array()); | 2390 owner()->ic_data_array()); |
| 2391 ReturnDefinition(call); | 2391 ReturnDefinition(call); |
| 2392 } | 2392 } |
| 2393 | 2393 |
| 2394 | 2394 |
| 2395 static intptr_t GetResultCidOfNative(const Function& function) { | 2395 static intptr_t GetResultCidOfNativeFactory(const Function& function) { |
| 2396 const Class& function_class = Class::Handle(function.Owner()); | 2396 const Class& function_class = Class::Handle(function.Owner()); |
| 2397 if (function_class.library() == Library::TypedDataLibrary()) { | 2397 if (function_class.library() == Library::TypedDataLibrary()) { |
| 2398 const String& function_name = String::Handle(function.name()); | 2398 const String& function_name = String::Handle(function.name()); |
| 2399 if (!String::EqualsIgnoringPrivateKey(function_name, Symbols::_New())) { | 2399 if (!String::EqualsIgnoringPrivateKey(function_name, Symbols::_New())) { |
| 2400 return kDynamicCid; | 2400 return kDynamicCid; |
| 2401 } | 2401 } |
| 2402 switch (function_class.id()) { | 2402 switch (function_class.id()) { |
| 2403 case kTypedDataInt8ArrayCid: | 2403 case kTypedDataInt8ArrayCid: |
| 2404 case kTypedDataUint8ArrayCid: | 2404 case kTypedDataUint8ArrayCid: |
| 2405 case kTypedDataUint8ClampedArrayCid: | 2405 case kTypedDataUint8ClampedArrayCid: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 2428 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2428 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 2429 new ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length()); | 2429 new ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length()); |
| 2430 BuildPushArguments(*node->arguments(), arguments); | 2430 BuildPushArguments(*node->arguments(), arguments); |
| 2431 StaticCallInstr* call = | 2431 StaticCallInstr* call = |
| 2432 new StaticCallInstr(node->token_pos(), | 2432 new StaticCallInstr(node->token_pos(), |
| 2433 node->function(), | 2433 node->function(), |
| 2434 node->arguments()->names(), | 2434 node->arguments()->names(), |
| 2435 arguments, | 2435 arguments, |
| 2436 owner()->ic_data_array()); | 2436 owner()->ic_data_array()); |
| 2437 if (node->function().is_native()) { | 2437 if (node->function().is_native()) { |
| 2438 const intptr_t result_cid = GetResultCidOfNative(node->function()); | 2438 const intptr_t result_cid = GetResultCidOfNativeFactory(node->function()); |
| 2439 call->set_result_cid(result_cid); | 2439 if (result_cid != kDynamicCid) { |
| 2440 call->set_result_cid(result_cid); |
| 2441 call->set_is_native_list_factory(true); |
| 2442 } |
| 2440 } | 2443 } |
| 2441 ReturnDefinition(call); | 2444 ReturnDefinition(call); |
| 2442 } | 2445 } |
| 2443 | 2446 |
| 2444 | 2447 |
| 2445 ClosureCallInstr* EffectGraphVisitor::BuildClosureCall( | 2448 ClosureCallInstr* EffectGraphVisitor::BuildClosureCall( |
| 2446 ClosureCallNode* node) { | 2449 ClosureCallNode* node) { |
| 2447 ValueGraphVisitor for_closure(owner()); | 2450 ValueGraphVisitor for_closure(owner()); |
| 2448 node->closure()->Visit(&for_closure); | 2451 node->closure()->Visit(&for_closure); |
| 2449 Append(for_closure); | 2452 Append(for_closure); |
| (...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3938 LanguageError::kError, | 3941 LanguageError::kError, |
| 3939 Heap::kNew, | 3942 Heap::kNew, |
| 3940 "FlowGraphBuilder Bailout: %s %s", | 3943 "FlowGraphBuilder Bailout: %s %s", |
| 3941 String::Handle(function.name()).ToCString(), | 3944 String::Handle(function.name()).ToCString(), |
| 3942 reason)); | 3945 reason)); |
| 3943 Isolate::Current()->long_jump_base()->Jump(1, error); | 3946 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3944 } | 3947 } |
| 3945 | 3948 |
| 3946 | 3949 |
| 3947 } // namespace dart | 3950 } // namespace dart |
| OLD | NEW |