| Index: runtime/vm/dart_api_impl.cc
|
| ===================================================================
|
| --- runtime/vm/dart_api_impl.cc (revision 14410)
|
| +++ runtime/vm/dart_api_impl.cc (working copy)
|
| @@ -33,7 +33,6 @@
|
| namespace dart {
|
|
|
| DECLARE_FLAG(bool, print_class_table);
|
| -DECLARE_FLAG(bool, use_cha);
|
|
|
| ThreadLocalKey Api::api_native_key_ = Thread::kUnsetThreadLocalKey;
|
|
|
| @@ -4002,45 +4001,11 @@
|
| }
|
|
|
|
|
| -// Removes optimized code once we load more classes, since --use_cha based
|
| -// optimizations may have become invalid.
|
| -// TODO(srdjan): Note which functions use which CHA decision and deoptimize
|
| -// only the necessary ones.
|
| -static void RemoveOptimizedCode() {
|
| - ASSERT(FLAG_use_cha);
|
| - // Deoptimize all live frames.
|
| - DeoptimizeAll();
|
| - // Switch all functions' code to unoptimized.
|
| - const ClassTable& class_table = *Isolate::Current()->class_table();
|
| - Class& cls = Class::Handle();
|
| - Array& array = Array::Handle();
|
| - Function& function = Function::Handle();
|
| - const intptr_t num_cids = class_table.NumCids();
|
| - for (intptr_t i = kInstanceCid; i < num_cids; i++) {
|
| - if (!class_table.HasValidClassAt(i)) continue;
|
| - cls = class_table.At(i);
|
| - ASSERT(!cls.IsNull());
|
| - array = cls.functions();
|
| - intptr_t num_functions = array.IsNull() ? 0 : array.Length();
|
| - for (intptr_t f = 0; f < num_functions; f++) {
|
| - function ^= array.At(f);
|
| - ASSERT(!function.IsNull());
|
| - if (function.HasOptimizedCode()) {
|
| - function.SwitchToUnoptimizedCode();
|
| - }
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url,
|
| Dart_Handle source) {
|
| TIMERSCOPE(time_script_loading);
|
| Isolate* isolate = Isolate::Current();
|
| DARTSCOPE(isolate);
|
| - if (FLAG_use_cha) {
|
| - RemoveOptimizedCode();
|
| - }
|
| const String& url_str = Api::UnwrapStringHandle(isolate, url);
|
| if (url_str.IsNull()) {
|
| RETURN_TYPE_ERROR(isolate, url, String);
|
| @@ -4078,9 +4043,6 @@
|
| if (buffer == NULL) {
|
| RETURN_NULL_ERROR(buffer);
|
| }
|
| - if (FLAG_use_cha) {
|
| - RemoveOptimizedCode();
|
| - }
|
| const Snapshot* snapshot = Snapshot::SetupFromBuffer(buffer);
|
| if (!snapshot->IsScriptSnapshot()) {
|
| return Api::NewError("%s expects parameter 'buffer' to be a script type"
|
| @@ -4252,9 +4214,6 @@
|
| TIMERSCOPE(time_script_loading);
|
| Isolate* isolate = Isolate::Current();
|
| DARTSCOPE(isolate);
|
| - if (FLAG_use_cha) {
|
| - RemoveOptimizedCode();
|
| - }
|
| const String& url_str = Api::UnwrapStringHandle(isolate, url);
|
| if (url_str.IsNull()) {
|
| RETURN_TYPE_ERROR(isolate, url, String);
|
| @@ -4344,9 +4303,6 @@
|
| TIMERSCOPE(time_script_loading);
|
| Isolate* isolate = Isolate::Current();
|
| DARTSCOPE(isolate);
|
| - if (FLAG_use_cha) {
|
| - RemoveOptimizedCode();
|
| - }
|
| const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
|
| if (lib.IsNull()) {
|
| RETURN_TYPE_ERROR(isolate, library, Library);
|
| @@ -4372,9 +4328,6 @@
|
| TIMERSCOPE(time_script_loading);
|
| Isolate* isolate = Isolate::Current();
|
| DARTSCOPE(isolate);
|
| - if (FLAG_use_cha) {
|
| - RemoveOptimizedCode();
|
| - }
|
| const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
|
| if (lib.IsNull()) {
|
| RETURN_TYPE_ERROR(isolate, library, Library);
|
|
|