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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 dependencies_[i] = NULL; | 131 dependencies_[i] = NULL; |
132 } | 132 } |
133 if (mode == STUB) { | 133 if (mode == STUB) { |
134 mode_ = STUB; | 134 mode_ = STUB; |
135 return; | 135 return; |
136 } | 136 } |
137 mode_ = mode; | 137 mode_ = mode; |
138 abort_due_to_dependency_ = false; | 138 abort_due_to_dependency_ = false; |
139 if (script_->type()->value() == Script::TYPE_NATIVE) MarkAsNative(); | 139 if (script_->type()->value() == Script::TYPE_NATIVE) MarkAsNative(); |
140 if (isolate_->debug()->is_active()) MarkAsDebug(); | 140 if (isolate_->debug()->is_active()) MarkAsDebug(); |
| 141 if (FLAG_context_specialization) MarkAsContextSpecializing(); |
141 | 142 |
142 if (!shared_info_.is_null()) { | 143 if (!shared_info_.is_null()) { |
143 DCHECK(strict_mode() == SLOPPY); | 144 DCHECK(strict_mode() == SLOPPY); |
144 SetStrictMode(shared_info_->strict_mode()); | 145 SetStrictMode(shared_info_->strict_mode()); |
145 } | 146 } |
146 set_bailout_reason(kUnknown); | 147 set_bailout_reason(kUnknown); |
147 | 148 |
148 if (!shared_info().is_null() && shared_info()->is_compiled()) { | 149 if (!shared_info().is_null() && shared_info()->is_compiled()) { |
149 // We should initialize the CompilationInfo feedback vector from the | 150 // We should initialize the CompilationInfo feedback vector from the |
150 // passed in shared info, rather than creating a new one. | 151 // passed in shared info, rather than creating a new one. |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 } | 1139 } |
1139 return MaybeHandle<Code>(); | 1140 return MaybeHandle<Code>(); |
1140 } | 1141 } |
1141 | 1142 |
1142 | 1143 |
1143 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) { | 1144 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) { |
1144 Handle<Code> code = info->code(); | 1145 Handle<Code> code = info->code(); |
1145 if (code->kind() != Code::OPTIMIZED_FUNCTION) return; // Nothing to do. | 1146 if (code->kind() != Code::OPTIMIZED_FUNCTION) return; // Nothing to do. |
1146 | 1147 |
1147 // Context specialization folds-in the context, so no sharing can occur. | 1148 // Context specialization folds-in the context, so no sharing can occur. |
1148 if (code->is_turbofanned() && FLAG_context_specialization) return; | 1149 if (code->is_turbofanned() && info->is_context_specializing()) return; |
1149 | 1150 |
1150 // Cache optimized code. | 1151 // Cache optimized code. |
1151 if (FLAG_cache_optimized_code) { | 1152 if (FLAG_cache_optimized_code) { |
1152 Handle<JSFunction> function = info->closure(); | 1153 Handle<JSFunction> function = info->closure(); |
1153 Handle<SharedFunctionInfo> shared(function->shared()); | 1154 Handle<SharedFunctionInfo> shared(function->shared()); |
1154 // Do not cache bound functions. | 1155 // Do not cache bound functions. |
1155 if (shared->bound()) return; | 1156 if (shared->bound()) return; |
1156 Handle<FixedArray> literals(function->literals()); | 1157 Handle<FixedArray> literals(function->literals()); |
1157 Handle<Context> native_context(function->context()->native_context()); | 1158 Handle<Context> native_context(function->context()->native_context()); |
1158 SharedFunctionInfo::AddToOptimizedCodeMap( | 1159 SharedFunctionInfo::AddToOptimizedCodeMap( |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1377 AllowHandleDereference allow_deref; | 1378 AllowHandleDereference allow_deref; |
1378 bool tracing_on = info()->IsStub() | 1379 bool tracing_on = info()->IsStub() |
1379 ? FLAG_trace_hydrogen_stubs | 1380 ? FLAG_trace_hydrogen_stubs |
1380 : (FLAG_trace_hydrogen && | 1381 : (FLAG_trace_hydrogen && |
1381 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1382 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1382 return (tracing_on && | 1383 return (tracing_on && |
1383 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1384 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1384 } | 1385 } |
1385 | 1386 |
1386 } } // namespace v8::internal | 1387 } } // namespace v8::internal |
OLD | NEW |