OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/kernel_reader.h" | 5 #include "vm/kernel_reader.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/kernel_binary.h" | 10 #include "vm/kernel_binary.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 field.set_has_initializer(kernel_field->initializer() != NULL); | 427 field.set_has_initializer(kernel_field->initializer() != NULL); |
428 GenerateFieldAccessors(klass, field, kernel_field); | 428 GenerateFieldAccessors(klass, field, kernel_field); |
429 fields_.Add(&field); | 429 fields_.Add(&field); |
430 } | 430 } |
431 klass.AddFields(fields_); | 431 klass.AddFields(fields_); |
432 } | 432 } |
433 | 433 |
434 for (intptr_t i = 0; i < kernel_klass->constructors().length(); i++) { | 434 for (intptr_t i = 0; i < kernel_klass->constructors().length(); i++) { |
435 Constructor* kernel_constructor = kernel_klass->constructors()[i]; | 435 Constructor* kernel_constructor = kernel_klass->constructors()[i]; |
436 ActiveMemberScope active_member_scope(&active_class_, kernel_constructor); | 436 ActiveMemberScope active_member_scope(&active_class_, kernel_constructor); |
437 ActiveFunctionScope active_function_scope(&active_class_, | |
438 kernel_constructor->function()); | |
439 | 437 |
440 const dart::String& name = | 438 const dart::String& name = |
441 H.DartConstructorName(kernel_constructor->canonical_name()); | 439 H.DartConstructorName(kernel_constructor->canonical_name()); |
442 Function& function = dart::Function::ZoneHandle( | 440 Function& function = dart::Function::ZoneHandle( |
443 Z, dart::Function::New(name, RawFunction::kConstructor, | 441 Z, dart::Function::New(name, RawFunction::kConstructor, |
444 false, // is_static | 442 false, // is_static |
445 kernel_constructor->IsConst(), | 443 kernel_constructor->IsConst(), |
446 false, // is_abstract | 444 false, // is_abstract |
447 kernel_constructor->IsExternal(), | 445 kernel_constructor->IsExternal(), |
448 false, // is_native | 446 false, // is_native |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 return klass; | 480 return klass; |
483 } | 481 } |
484 | 482 |
485 | 483 |
486 void KernelReader::ReadProcedure(const dart::Library& library, | 484 void KernelReader::ReadProcedure(const dart::Library& library, |
487 const dart::Class& owner, | 485 const dart::Class& owner, |
488 Procedure* kernel_procedure, | 486 Procedure* kernel_procedure, |
489 Class* kernel_klass) { | 487 Class* kernel_klass) { |
490 ActiveClassScope active_class_scope(&active_class_, kernel_klass, &owner); | 488 ActiveClassScope active_class_scope(&active_class_, kernel_klass, &owner); |
491 ActiveMemberScope active_member_scope(&active_class_, kernel_procedure); | 489 ActiveMemberScope active_member_scope(&active_class_, kernel_procedure); |
492 ActiveFunctionScope active_function_scope(&active_class_, | |
493 kernel_procedure->function()); | |
494 | 490 |
495 const dart::String& name = | 491 const dart::String& name = |
496 H.DartProcedureName(kernel_procedure->canonical_name()); | 492 H.DartProcedureName(kernel_procedure->canonical_name()); |
497 bool is_method = kernel_klass != NULL && !kernel_procedure->IsStatic(); | 493 bool is_method = kernel_klass != NULL && !kernel_procedure->IsStatic(); |
498 bool is_abstract = kernel_procedure->IsAbstract(); | 494 bool is_abstract = kernel_procedure->IsAbstract(); |
499 bool is_external = kernel_procedure->IsExternal(); | 495 bool is_external = kernel_procedure->IsExternal(); |
500 dart::String* native_name = NULL; | 496 dart::String* native_name = NULL; |
501 if (is_external) { | 497 if (is_external) { |
502 // Maybe it has a native implementation, which is not external as far as | 498 // Maybe it has a native implementation, which is not external as far as |
503 // the VM is concerned because it does have an implementation. Check for | 499 // the VM is concerned because it does have an implementation. Check for |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 initializer_fun.set_is_debuggable(false); | 938 initializer_fun.set_is_debuggable(false); |
943 initializer_fun.set_is_reflectable(false); | 939 initializer_fun.set_is_reflectable(false); |
944 initializer_fun.set_is_inlinable(false); | 940 initializer_fun.set_is_inlinable(false); |
945 return new (zone) ParsedFunction(thread, initializer_fun); | 941 return new (zone) ParsedFunction(thread, initializer_fun); |
946 } | 942 } |
947 | 943 |
948 | 944 |
949 } // namespace kernel | 945 } // namespace kernel |
950 } // namespace dart | 946 } // namespace dart |
951 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 947 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |