| Index: runtime/vm/isolate.cc
|
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
|
| index 9381e1f74b1cb9c29907c14d357c67c92064d5fe..d6f84bdea34da0d0b71709ddc02e7789ee1e0f94 100644
|
| --- a/runtime/vm/isolate.cc
|
| +++ b/runtime/vm/isolate.cc
|
| @@ -691,12 +691,18 @@ MessageHandler::MessageStatus IsolateMessageHandler::ProcessUnhandledException(
|
| }
|
|
|
| void Isolate::FlagsInitialize(Dart_IsolateFlags* api_flags) {
|
| + const bool false_by_default = false;
|
| + const bool true_by_default = true;
|
| + USE(true_by_default);
|
| + USE(false_by_default);
|
| +
|
| api_flags->version = DART_FLAGS_CURRENT_VERSION;
|
| #define INIT_FROM_FLAG(name, bitname, isolate_flag, flag) \
|
| api_flags->isolate_flag = flag;
|
| ISOLATE_FLAG_LIST(INIT_FROM_FLAG)
|
| #undef INIT_FROM_FLAG
|
| api_flags->use_dart_frontend = false;
|
| + api_flags->entry_points = NULL;
|
| }
|
|
|
| void Isolate::FlagsCopyTo(Dart_IsolateFlags* api_flags) const {
|
| @@ -706,6 +712,7 @@ void Isolate::FlagsCopyTo(Dart_IsolateFlags* api_flags) const {
|
| ISOLATE_FLAG_LIST(INIT_FROM_FIELD)
|
| #undef INIT_FROM_FIELD
|
| api_flags->use_dart_frontend = use_dart_frontend();
|
| + api_flags->entry_points = NULL;
|
| }
|
|
|
| void Isolate::FlagsCopyFrom(const Dart_IsolateFlags& api_flags) {
|
| @@ -716,6 +723,26 @@ void Isolate::FlagsCopyFrom(const Dart_IsolateFlags& api_flags) {
|
| #undef SET_FROM_FLAG
|
| #endif // !defined(PRODUCT)
|
| set_use_dart_frontend(api_flags.use_dart_frontend);
|
| +
|
| + // Copy entry points list.
|
| + ASSERT(embedder_entry_points_ == NULL);
|
| + if (api_flags.entry_points != NULL) {
|
| + intptr_t count = 0;
|
| + while (api_flags.entry_points[count].function_name != NULL)
|
| + count++;
|
| + embedder_entry_points_ = new Dart_QualifiedFunctionName[count + 1];
|
| + for (intptr_t i = 0; i < count; i++) {
|
| + embedder_entry_points_[i].library_uri =
|
| + strdup(api_flags.entry_points[i].library_uri);
|
| + embedder_entry_points_[i].class_name =
|
| + strdup(api_flags.entry_points[i].class_name);
|
| + embedder_entry_points_[i].function_name =
|
| + strdup(api_flags.entry_points[i].function_name);
|
| + }
|
| + memset(&embedder_entry_points_[count], 0,
|
| + sizeof(Dart_QualifiedFunctionName));
|
| + }
|
| +
|
| // Leave others at defaults.
|
| }
|
|
|
| @@ -815,7 +842,9 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
|
| spawn_count_monitor_(new Monitor()),
|
| spawn_count_(0),
|
| handler_info_cache_(),
|
| - catch_entry_state_cache_() {
|
| + catch_entry_state_cache_(),
|
| + embedder_entry_points_(NULL),
|
| + obfuscation_map_(NULL) {
|
| FlagsCopyFrom(api_flags);
|
| SetErrorsFatal(true);
|
| set_compilation_allowed(true);
|
| @@ -823,6 +852,13 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
|
| // how the vm_tag (kEmbedderTagId) can be set, these tags need to
|
| // move to the OSThread structure.
|
| set_user_tag(UserTags::kDefaultUserTag);
|
| +
|
| + if (obfuscate()) {
|
| + OS::PrintErr(
|
| + "Warning: This VM has been configured to obfuscate symbol information "
|
| + "which violates the Dart standard.\n"
|
| + " See dartbug.com/30524 for more information.\n");
|
| + }
|
| }
|
|
|
| #undef REUSABLE_HANDLE_SCOPE_INIT
|
| @@ -870,6 +906,22 @@ Isolate::~Isolate() {
|
| delete spawn_count_monitor_;
|
| delete safepoint_handler_;
|
| delete thread_registry_;
|
| +
|
| + if (obfuscation_map_ != NULL) {
|
| + for (intptr_t i = 0; obfuscation_map_[i] != NULL; i++) {
|
| + delete[] obfuscation_map_[i];
|
| + }
|
| + delete[] obfuscation_map_;
|
| + }
|
| +
|
| + if (embedder_entry_points_ != NULL) {
|
| + for (intptr_t i = 0; embedder_entry_points_[i].function_name != NULL; i++) {
|
| + free(const_cast<char*>(embedder_entry_points_[i].library_uri));
|
| + free(const_cast<char*>(embedder_entry_points_[i].class_name));
|
| + free(const_cast<char*>(embedder_entry_points_[i].function_name));
|
| + }
|
| + delete[] embedder_entry_points_;
|
| + }
|
| }
|
|
|
| void Isolate::InitOnce() {
|
|
|