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/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 return AbortOptimization(kTooManyParameters); | 505 return AbortOptimization(kTooManyParameters); |
506 } | 506 } |
507 | 507 |
508 if (info()->is_osr() && | 508 if (info()->is_osr() && |
509 LUnallocated::TooManyParametersOrStackSlots(scope->num_parameters(), | 509 LUnallocated::TooManyParametersOrStackSlots(scope->num_parameters(), |
510 scope->num_stack_slots())) { | 510 scope->num_stack_slots())) { |
511 // Crankshaft would require too many Lithium operands. | 511 // Crankshaft would require too many Lithium operands. |
512 return AbortOptimization(kTooManyParametersLocals); | 512 return AbortOptimization(kTooManyParametersLocals); |
513 } | 513 } |
514 | 514 |
515 if (scope->HasIllegalRedeclaration()) { | |
516 // Crankshaft cannot handle illegal redeclarations. | |
517 return AbortOptimization(kFunctionWithIllegalRedeclaration); | |
518 } | |
519 | |
520 if (FLAG_trace_opt) { | 515 if (FLAG_trace_opt) { |
521 OFStream os(stdout); | 516 OFStream os(stdout); |
522 os << "[compiling method " << Brief(*info()->closure()) | 517 os << "[compiling method " << Brief(*info()->closure()) |
523 << " using Crankshaft"; | 518 << " using Crankshaft"; |
524 if (info()->is_osr()) os << " OSR"; | 519 if (info()->is_osr()) os << " OSR"; |
525 os << "]" << std::endl; | 520 os << "]" << std::endl; |
526 } | 521 } |
527 | 522 |
528 if (FLAG_trace_hydrogen) { | 523 if (FLAG_trace_hydrogen) { |
529 isolate()->GetHTracer()->TraceCompilation(info()); | 524 isolate()->GetHTracer()->TraceCompilation(info()); |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1953 MaybeHandle<Code> code; | 1948 MaybeHandle<Code> code; |
1954 if (cached.code != nullptr) code = handle(cached.code); | 1949 if (cached.code != nullptr) code = handle(cached.code); |
1955 Handle<Context> native_context(function->context()->native_context()); | 1950 Handle<Context> native_context(function->context()->native_context()); |
1956 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1951 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
1957 literals, BailoutId::None()); | 1952 literals, BailoutId::None()); |
1958 } | 1953 } |
1959 } | 1954 } |
1960 | 1955 |
1961 } // namespace internal | 1956 } // namespace internal |
1962 } // namespace v8 | 1957 } // namespace v8 |
OLD | NEW |