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 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 8459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8470 function->ReplaceCode(*unoptimized); | 8470 function->ReplaceCode(*unoptimized); |
8471 return function->code(); | 8471 return function->code(); |
8472 } | 8472 } |
8473 | 8473 |
8474 Compiler::ConcurrencyMode mode = | 8474 Compiler::ConcurrencyMode mode = |
8475 concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT; | 8475 concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT; |
8476 Handle<Code> code; | 8476 Handle<Code> code; |
8477 if (Compiler::GetOptimizedCode(function, unoptimized, mode).ToHandle(&code)) { | 8477 if (Compiler::GetOptimizedCode(function, unoptimized, mode).ToHandle(&code)) { |
8478 function->ReplaceCode(*code); | 8478 function->ReplaceCode(*code); |
8479 } else { | 8479 } else { |
8480 function->ReplaceCode(*unoptimized); | 8480 function->ReplaceCode(function->shared()->code()); |
8481 } | 8481 } |
8482 | 8482 |
8483 DCHECK(function->code()->kind() == Code::FUNCTION || | 8483 DCHECK(function->code()->kind() == Code::FUNCTION || |
8484 function->code()->kind() == Code::OPTIMIZED_FUNCTION || | 8484 function->code()->kind() == Code::OPTIMIZED_FUNCTION || |
8485 function->IsInOptimizationQueue()); | 8485 function->IsInOptimizationQueue()); |
8486 return function->code(); | 8486 return function->code(); |
8487 } | 8487 } |
8488 | 8488 |
8489 | 8489 |
8490 class ActivationsFinder : public ThreadVisitor { | 8490 class ActivationsFinder : public ThreadVisitor { |
(...skipping 7149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15640 } | 15640 } |
15641 return NULL; | 15641 return NULL; |
15642 } | 15642 } |
15643 | 15643 |
15644 | 15644 |
15645 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15645 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15646 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15646 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15647 } | 15647 } |
15648 | 15648 |
15649 } } // namespace v8::internal | 15649 } } // namespace v8::internal |
OLD | NEW |