OLD | NEW |
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 | 5 |
6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
8 #define V8_SHARED | 8 #define V8_SHARED |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 return GetCounter(name, true); | 831 return GetCounter(name, true); |
832 } | 832 } |
833 | 833 |
834 | 834 |
835 void Shell::AddHistogramSample(void* histogram, int sample) { | 835 void Shell::AddHistogramSample(void* histogram, int sample) { |
836 Counter* counter = reinterpret_cast<Counter*>(histogram); | 836 Counter* counter = reinterpret_cast<Counter*>(histogram); |
837 counter->AddSample(sample); | 837 counter->AddSample(sample); |
838 } | 838 } |
839 | 839 |
840 | 840 |
| 841 class NoUseStrongForUtilityScriptScope { |
| 842 public: |
| 843 NoUseStrongForUtilityScriptScope() : flag_(i::FLAG_use_strong) { |
| 844 i::FLAG_use_strong = false; |
| 845 } |
| 846 ~NoUseStrongForUtilityScriptScope() { i::FLAG_use_strong = flag_; } |
| 847 |
| 848 private: |
| 849 bool flag_; |
| 850 }; |
| 851 |
| 852 |
841 void Shell::InstallUtilityScript(Isolate* isolate) { | 853 void Shell::InstallUtilityScript(Isolate* isolate) { |
| 854 NoUseStrongForUtilityScriptScope no_use_strong; |
842 HandleScope scope(isolate); | 855 HandleScope scope(isolate); |
843 // If we use the utility context, we have to set the security tokens so that | 856 // If we use the utility context, we have to set the security tokens so that |
844 // utility, evaluation and debug context can all access each other. | 857 // utility, evaluation and debug context can all access each other. |
845 v8::Local<v8::Context> utility_context = | 858 v8::Local<v8::Context> utility_context = |
846 v8::Local<v8::Context>::New(isolate, utility_context_); | 859 v8::Local<v8::Context>::New(isolate, utility_context_); |
847 v8::Local<v8::Context> evaluation_context = | 860 v8::Local<v8::Context> evaluation_context = |
848 v8::Local<v8::Context>::New(isolate, evaluation_context_); | 861 v8::Local<v8::Context>::New(isolate, evaluation_context_); |
849 utility_context->SetSecurityToken(Undefined(isolate)); | 862 utility_context->SetSecurityToken(Undefined(isolate)); |
850 evaluation_context->SetSecurityToken(Undefined(isolate)); | 863 evaluation_context->SetSecurityToken(Undefined(isolate)); |
851 v8::Context::Scope context_scope(utility_context); | 864 v8::Context::Scope context_scope(utility_context); |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 } | 1710 } |
1698 | 1711 |
1699 } // namespace v8 | 1712 } // namespace v8 |
1700 | 1713 |
1701 | 1714 |
1702 #ifndef GOOGLE3 | 1715 #ifndef GOOGLE3 |
1703 int main(int argc, char* argv[]) { | 1716 int main(int argc, char* argv[]) { |
1704 return v8::Shell::Main(argc, argv); | 1717 return v8::Shell::Main(argc, argv); |
1705 } | 1718 } |
1706 #endif | 1719 #endif |
OLD | NEW |