Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(944)

Side by Side Diff: src/isolate.cc

Issue 1842763002: [api] Add a switch that controls if ES2015 tail call elimination feature is enabled or not. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-dynamic
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 2863 matching lines...) Expand 10 before | Expand all | Expand 10 after
2874 std::string Isolate::GetTurboCfgFileName() { 2874 std::string Isolate::GetTurboCfgFileName() {
2875 if (FLAG_trace_turbo_cfg_file == NULL) { 2875 if (FLAG_trace_turbo_cfg_file == NULL) {
2876 std::ostringstream os; 2876 std::ostringstream os;
2877 os << "turbo-" << base::OS::GetCurrentProcessId() << "-" << id() << ".cfg"; 2877 os << "turbo-" << base::OS::GetCurrentProcessId() << "-" << id() << ".cfg";
2878 return os.str(); 2878 return os.str();
2879 } else { 2879 } else {
2880 return FLAG_trace_turbo_cfg_file; 2880 return FLAG_trace_turbo_cfg_file;
2881 } 2881 }
2882 } 2882 }
2883 2883
2884 void Isolate::SetTailCallEliminationEnabled(bool enabled) {
2885 if (is_tail_call_elimination_enabled_ == enabled) return;
2886 is_tail_call_elimination_enabled_ = enabled;
2887 // This is a big hammer but we don't expect this to happen frequently.
2888 internal::Deoptimizer::DeoptimizeAll(this);
2889 }
2884 2890
2885 // Heap::detached_contexts tracks detached contexts as pairs 2891 // Heap::detached_contexts tracks detached contexts as pairs
2886 // (number of GC since the context was detached, the context). 2892 // (number of GC since the context was detached, the context).
2887 void Isolate::AddDetachedContext(Handle<Context> context) { 2893 void Isolate::AddDetachedContext(Handle<Context> context) {
2888 HandleScope scope(this); 2894 HandleScope scope(this);
2889 Handle<WeakCell> cell = factory()->NewWeakCell(context); 2895 Handle<WeakCell> cell = factory()->NewWeakCell(context);
2890 Handle<FixedArray> detached_contexts(heap()->detached_contexts()); 2896 Handle<FixedArray> detached_contexts(heap()->detached_contexts());
2891 int length = detached_contexts->length(); 2897 int length = detached_contexts->length();
2892 detached_contexts = factory()->CopyFixedArrayAndGrow(detached_contexts, 2); 2898 detached_contexts = factory()->CopyFixedArrayAndGrow(detached_contexts, 2);
2893 detached_contexts->set(length, Smi::FromInt(0)); 2899 detached_contexts->set(length, Smi::FromInt(0));
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
2976 // Then check whether this scope intercepts. 2982 // Then check whether this scope intercepts.
2977 if ((flag & intercept_mask_)) { 2983 if ((flag & intercept_mask_)) {
2978 intercepted_flags_ |= flag; 2984 intercepted_flags_ |= flag;
2979 return true; 2985 return true;
2980 } 2986 }
2981 return false; 2987 return false;
2982 } 2988 }
2983 2989
2984 } // namespace internal 2990 } // namespace internal
2985 } // namespace v8 2991 } // namespace v8
OLDNEW
« include/v8-debug.h ('K') | « src/isolate.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698