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

Side by Side Diff: src/runtime.cc

Issue 14139033: Clean up VMState a little bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed mistake Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/profile-generator-inl.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 8876 matching lines...) Expand 10 before | Expand all | Expand 10 after
8887 Handle<Context> context) { 8887 Handle<Context> context) {
8888 ASSERT(context->allow_code_gen_from_strings()->IsFalse()); 8888 ASSERT(context->allow_code_gen_from_strings()->IsFalse());
8889 // Check with callback if set. 8889 // Check with callback if set.
8890 AllowCodeGenerationFromStringsCallback callback = 8890 AllowCodeGenerationFromStringsCallback callback =
8891 isolate->allow_code_gen_callback(); 8891 isolate->allow_code_gen_callback();
8892 if (callback == NULL) { 8892 if (callback == NULL) {
8893 // No callback set and code generation disallowed. 8893 // No callback set and code generation disallowed.
8894 return false; 8894 return false;
8895 } else { 8895 } else {
8896 // Callback set. Let it decide if code generation is allowed. 8896 // Callback set. Let it decide if code generation is allowed.
8897 VMState state(isolate, EXTERNAL); 8897 VMState<EXTERNAL> state(isolate);
8898 return callback(v8::Utils::ToLocal(context)); 8898 return callback(v8::Utils::ToLocal(context));
8899 } 8899 }
8900 } 8900 }
8901 8901
8902 8902
8903 RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileString) { 8903 RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileString) {
8904 HandleScope scope(isolate); 8904 HandleScope scope(isolate);
8905 ASSERT_EQ(2, args.length()); 8905 ASSERT_EQ(2, args.length());
8906 CONVERT_ARG_HANDLE_CHECKED(String, source, 0); 8906 CONVERT_ARG_HANDLE_CHECKED(String, source, 0);
8907 CONVERT_BOOLEAN_ARG_CHECKED(function_literal_only, 1); 8907 CONVERT_BOOLEAN_ARG_CHECKED(function_literal_only, 1);
(...skipping 4383 matching lines...) Expand 10 before | Expand all | Expand 10 after
13291 // Handle last resort GC and make sure to allow future allocations 13291 // Handle last resort GC and make sure to allow future allocations
13292 // to grow the heap without causing GCs (if possible). 13292 // to grow the heap without causing GCs (if possible).
13293 isolate->counters()->gc_last_resort_from_js()->Increment(); 13293 isolate->counters()->gc_last_resort_from_js()->Increment();
13294 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13294 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13295 "Runtime::PerformGC"); 13295 "Runtime::PerformGC");
13296 } 13296 }
13297 } 13297 }
13298 13298
13299 13299
13300 } } // namespace v8::internal 13300 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator-inl.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698