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/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/ast-this-access-visitor.h" | 10 #include "src/ast-this-access-visitor.h" |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 | 1231 |
1232 Debug::RecordEvalCaller(script); | 1232 Debug::RecordEvalCaller(script); |
1233 | 1233 |
1234 shared_info = CompileToplevel(&info); | 1234 shared_info = CompileToplevel(&info); |
1235 | 1235 |
1236 if (shared_info.is_null()) { | 1236 if (shared_info.is_null()) { |
1237 return MaybeHandle<JSFunction>(); | 1237 return MaybeHandle<JSFunction>(); |
1238 } else { | 1238 } else { |
1239 // Explicitly disable optimization for eval code. We're not yet prepared | 1239 // Explicitly disable optimization for eval code. We're not yet prepared |
1240 // to handle eval-code in the optimizing compiler. | 1240 // to handle eval-code in the optimizing compiler. |
1241 shared_info->DisableOptimization(kEval); | 1241 if (restriction != ONLY_SINGLE_FUNCTION_LITERAL) { |
| 1242 shared_info->DisableOptimization(kEval); |
| 1243 } |
1242 | 1244 |
1243 // If caller is strict mode, the result must be in strict mode as well. | 1245 // If caller is strict mode, the result must be in strict mode as well. |
1244 DCHECK(strict_mode == SLOPPY || shared_info->strict_mode() == STRICT); | 1246 DCHECK(strict_mode == SLOPPY || shared_info->strict_mode() == STRICT); |
1245 if (!shared_info->dont_cache()) { | 1247 if (!shared_info->dont_cache()) { |
1246 compilation_cache->PutEval(source, outer_info, context, shared_info, | 1248 compilation_cache->PutEval(source, outer_info, context, shared_info, |
1247 scope_position); | 1249 scope_position); |
1248 } | 1250 } |
1249 } | 1251 } |
1250 } else if (shared_info->ic_age() != isolate->heap()->global_ic_age()) { | 1252 } else if (shared_info->ic_age() != isolate->heap()->global_ic_age()) { |
1251 shared_info->ResetForNewContext(isolate->heap()->global_ic_age()); | 1253 shared_info->ResetForNewContext(isolate->heap()->global_ic_age()); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 AllowHandleDereference allow_deref; | 1578 AllowHandleDereference allow_deref; |
1577 bool tracing_on = info()->IsStub() | 1579 bool tracing_on = info()->IsStub() |
1578 ? FLAG_trace_hydrogen_stubs | 1580 ? FLAG_trace_hydrogen_stubs |
1579 : (FLAG_trace_hydrogen && | 1581 : (FLAG_trace_hydrogen && |
1580 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1582 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1581 return (tracing_on && | 1583 return (tracing_on && |
1582 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1584 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1583 } | 1585 } |
1584 | 1586 |
1585 } } // namespace v8::internal | 1587 } } // namespace v8::internal |
OLD | NEW |