OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
| 8 #include "src/bootstrapper.h" |
8 #include "src/conversions.h" | 9 #include "src/conversions.h" |
9 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
10 #include "src/macro-assembler.h" | 11 #include "src/macro-assembler.h" |
11 | 12 |
12 namespace v8 { | 13 namespace v8 { |
13 namespace internal { | 14 namespace internal { |
14 | 15 |
15 | 16 |
16 template<typename T> | 17 template<typename T> |
17 Handle<T> Factory::New(Handle<Map> map, AllocationSpace space) { | 18 Handle<T> Factory::New(Handle<Map> map, AllocationSpace space) { |
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 if (literals != NULL) result->set_literals(literals); | 1366 if (literals != NULL) result->set_literals(literals); |
1366 Code* code = info->GetCodeFromOptimizedCodeMap(index); | 1367 Code* code = info->GetCodeFromOptimizedCodeMap(index); |
1367 ASSERT(!code->marked_for_deoptimization()); | 1368 ASSERT(!code->marked_for_deoptimization()); |
1368 result->ReplaceCode(code); | 1369 result->ReplaceCode(code); |
1369 return result; | 1370 return result; |
1370 } | 1371 } |
1371 | 1372 |
1372 if (isolate()->use_crankshaft() && | 1373 if (isolate()->use_crankshaft() && |
1373 FLAG_always_opt && | 1374 FLAG_always_opt && |
1374 result->is_compiled() && | 1375 result->is_compiled() && |
1375 !info->is_toplevel() && | 1376 // TODO(mstarzinger): Extend to optimization of builtin code. |
| 1377 !isolate()->bootstrapper()->IsActive() && |
1376 info->allows_lazy_compilation() && | 1378 info->allows_lazy_compilation() && |
1377 !info->optimization_disabled() && | 1379 !info->optimization_disabled() && |
1378 !isolate()->DebuggerHasBreakPoints()) { | 1380 !isolate()->DebuggerHasBreakPoints()) { |
1379 result->MarkForOptimization(); | 1381 result->MarkForOptimization(); |
1380 } | 1382 } |
1381 return result; | 1383 return result; |
1382 } | 1384 } |
1383 | 1385 |
1384 | 1386 |
1385 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { | 1387 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2365 return Handle<Object>::null(); | 2367 return Handle<Object>::null(); |
2366 } | 2368 } |
2367 | 2369 |
2368 | 2370 |
2369 Handle<Object> Factory::ToBoolean(bool value) { | 2371 Handle<Object> Factory::ToBoolean(bool value) { |
2370 return value ? true_value() : false_value(); | 2372 return value ? true_value() : false_value(); |
2371 } | 2373 } |
2372 | 2374 |
2373 | 2375 |
2374 } } // namespace v8::internal | 2376 } } // namespace v8::internal |
OLD | NEW |