OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 15 matching lines...) Expand all Loading... |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 #include "hydrogen.h" | 29 #include "hydrogen.h" |
30 | 30 |
31 #include "codegen.h" | 31 #include "codegen.h" |
32 #include "full-codegen.h" | 32 #include "full-codegen.h" |
33 #include "hashmap.h" | 33 #include "hashmap.h" |
34 #include "lithium-allocator.h" | 34 #include "lithium-allocator.h" |
35 #include "parser.h" | 35 #include "parser.h" |
| 36 #include "scopeinfo.h" |
36 #include "scopes.h" | 37 #include "scopes.h" |
37 #include "stub-cache.h" | 38 #include "stub-cache.h" |
38 | 39 |
39 #if V8_TARGET_ARCH_IA32 | 40 #if V8_TARGET_ARCH_IA32 |
40 #include "ia32/lithium-codegen-ia32.h" | 41 #include "ia32/lithium-codegen-ia32.h" |
41 #elif V8_TARGET_ARCH_X64 | 42 #elif V8_TARGET_ARCH_X64 |
42 #include "x64/lithium-codegen-x64.h" | 43 #include "x64/lithium-codegen-x64.h" |
43 #elif V8_TARGET_ARCH_ARM | 44 #elif V8_TARGET_ARCH_ARM |
44 #include "arm/lithium-codegen-arm.h" | 45 #include "arm/lithium-codegen-arm.h" |
45 #elif V8_TARGET_ARCH_MIPS | 46 #elif V8_TARGET_ARCH_MIPS |
(...skipping 4377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4423 // Generate the deoptimization data for the unoptimized version of | 4424 // Generate the deoptimization data for the unoptimized version of |
4424 // the target function if we don't already have it. | 4425 // the target function if we don't already have it. |
4425 if (!target_shared->has_deoptimization_support()) { | 4426 if (!target_shared->has_deoptimization_support()) { |
4426 // Note that we compile here using the same AST that we will use for | 4427 // Note that we compile here using the same AST that we will use for |
4427 // generating the optimized inline code. | 4428 // generating the optimized inline code. |
4428 target_info.EnableDeoptimizationSupport(); | 4429 target_info.EnableDeoptimizationSupport(); |
4429 if (!FullCodeGenerator::MakeCode(&target_info)) { | 4430 if (!FullCodeGenerator::MakeCode(&target_info)) { |
4430 TraceInline(target, caller, "could not generate deoptimization info"); | 4431 TraceInline(target, caller, "could not generate deoptimization info"); |
4431 return false; | 4432 return false; |
4432 } | 4433 } |
| 4434 if (target_shared->scope_info() == SerializedScopeInfo::Empty()) { |
| 4435 // The scope info might not have been set if a lazily compiled |
| 4436 // function is inlined before being called for the first time. |
| 4437 Handle<SerializedScopeInfo> target_scope_info = |
| 4438 SerializedScopeInfo::Create(target_info.scope()); |
| 4439 target_shared->set_scope_info(*target_scope_info); |
| 4440 } |
4433 target_shared->EnableDeoptimizationSupport(*target_info.code()); | 4441 target_shared->EnableDeoptimizationSupport(*target_info.code()); |
4434 Compiler::RecordFunctionCompilation(Logger::FUNCTION_TAG, | 4442 Compiler::RecordFunctionCompilation(Logger::FUNCTION_TAG, |
4435 &target_info, | 4443 &target_info, |
4436 target_shared); | 4444 target_shared); |
4437 } | 4445 } |
4438 | 4446 |
4439 // ---------------------------------------------------------------- | 4447 // ---------------------------------------------------------------- |
4440 // After this point, we've made a decision to inline this function (so | 4448 // After this point, we've made a decision to inline this function (so |
4441 // TryInline should always return true). | 4449 // TryInline should always return true). |
4442 | 4450 |
(...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6577 } | 6585 } |
6578 } | 6586 } |
6579 | 6587 |
6580 #ifdef DEBUG | 6588 #ifdef DEBUG |
6581 if (graph_ != NULL) graph_->Verify(); | 6589 if (graph_ != NULL) graph_->Verify(); |
6582 if (allocator_ != NULL) allocator_->Verify(); | 6590 if (allocator_ != NULL) allocator_->Verify(); |
6583 #endif | 6591 #endif |
6584 } | 6592 } |
6585 | 6593 |
6586 } } // namespace v8::internal | 6594 } } // namespace v8::internal |
OLD | NEW |