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

Side by Side Diff: src/runtime.cc

Issue 23441029: Move global V8::UseCrankshaft() into the Isolate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Sven Panne. Created 7 years, 3 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/isolate.cc ('k') | src/v8.h » ('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 8328 matching lines...) Expand 10 before | Expand all | Expand 10 after
8339 ASSERT(FLAG_concurrent_recompilation); 8339 ASSERT(FLAG_concurrent_recompilation);
8340 Compiler::RecompileConcurrent(function); 8340 Compiler::RecompileConcurrent(function);
8341 return isolate->heap()->undefined_value(); 8341 return isolate->heap()->undefined_value();
8342 } 8342 }
8343 8343
8344 8344
8345 RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) { 8345 RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) {
8346 HandleScope handle_scope(isolate); 8346 HandleScope handle_scope(isolate);
8347 ASSERT(args.length() == 1); 8347 ASSERT(args.length() == 1);
8348 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 8348 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8349 ASSERT(V8::UseCrankshaft() && FLAG_concurrent_recompilation); 8349 ASSERT(isolate->use_crankshaft() && FLAG_concurrent_recompilation);
8350 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); 8350 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
8351 return function->code(); 8351 return function->code();
8352 } 8352 }
8353 8353
8354 8354
8355 class ActivationsFinder : public ThreadVisitor { 8355 class ActivationsFinder : public ThreadVisitor {
8356 public: 8356 public:
8357 Code* code_; 8357 Code* code_;
8358 bool has_code_activations_; 8358 bool has_code_activations_;
8359 8359
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
8525 CONVERT_ARG_CHECKED(JSFunction, function, 0); 8525 CONVERT_ARG_CHECKED(JSFunction, function, 0);
8526 ASSERT(!function->IsOptimized()); 8526 ASSERT(!function->IsOptimized());
8527 function->shared()->set_optimization_disabled(true); 8527 function->shared()->set_optimization_disabled(true);
8528 return isolate->heap()->undefined_value(); 8528 return isolate->heap()->undefined_value();
8529 } 8529 }
8530 8530
8531 8531
8532 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { 8532 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
8533 HandleScope scope(isolate); 8533 HandleScope scope(isolate);
8534 RUNTIME_ASSERT(args.length() == 1 || args.length() == 2); 8534 RUNTIME_ASSERT(args.length() == 1 || args.length() == 2);
8535 if (!V8::UseCrankshaft()) { 8535 if (!isolate->use_crankshaft()) {
8536 return Smi::FromInt(4); // 4 == "never". 8536 return Smi::FromInt(4); // 4 == "never".
8537 } 8537 }
8538 bool sync_with_compiler_thread = true; 8538 bool sync_with_compiler_thread = true;
8539 if (args.length() == 2) { 8539 if (args.length() == 2) {
8540 CONVERT_ARG_HANDLE_CHECKED(String, sync, 1); 8540 CONVERT_ARG_HANDLE_CHECKED(String, sync, 1);
8541 if (sync->IsOneByteEqualTo(STATIC_ASCII_VECTOR("no sync"))) { 8541 if (sync->IsOneByteEqualTo(STATIC_ASCII_VECTOR("no sync"))) {
8542 sync_with_compiler_thread = false; 8542 sync_with_compiler_thread = false;
8543 } 8543 }
8544 } 8544 }
8545 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 8545 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
(...skipping 6149 matching lines...) Expand 10 before | Expand all | Expand 10 after
14695 // Handle last resort GC and make sure to allow future allocations 14695 // Handle last resort GC and make sure to allow future allocations
14696 // to grow the heap without causing GCs (if possible). 14696 // to grow the heap without causing GCs (if possible).
14697 isolate->counters()->gc_last_resort_from_js()->Increment(); 14697 isolate->counters()->gc_last_resort_from_js()->Increment();
14698 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14698 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14699 "Runtime::PerformGC"); 14699 "Runtime::PerformGC");
14700 } 14700 }
14701 } 14701 }
14702 14702
14703 14703
14704 } } // namespace v8::internal 14704 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/v8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698