Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: src/factory.cc

Issue 1208013002: [turbofan] Implement sharing of context-independent code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_opt-code-map-3
Patch Set: Disable test for GC stress. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 if (cached.code != nullptr) { 1383 if (cached.code != nullptr) {
1384 // Caching of optimized code enabled and optimized code found. 1384 // Caching of optimized code enabled and optimized code found.
1385 if (cached.literals != nullptr) result->set_literals(cached.literals); 1385 if (cached.literals != nullptr) result->set_literals(cached.literals);
1386 DCHECK(!cached.code->marked_for_deoptimization()); 1386 DCHECK(!cached.code->marked_for_deoptimization());
1387 DCHECK(result->shared()->is_compiled()); 1387 DCHECK(result->shared()->is_compiled());
1388 result->ReplaceCode(cached.code); 1388 result->ReplaceCode(cached.code);
1389 } 1389 }
1390 1390
1391 if (cached.literals == nullptr && !info->bound()) { 1391 if (cached.literals == nullptr && !info->bound()) {
1392 int number_of_literals = info->num_literals(); 1392 int number_of_literals = info->num_literals();
1393 // TODO(mstarzinger): Consider sharing the newly created literals array.
1393 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); 1394 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure);
1394 result->set_literals(*literals); 1395 result->set_literals(*literals);
1395 } 1396 }
1396 1397
1397 return result; 1398 return result;
1398 } 1399 }
1399 1400
1400 1401
1401 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { 1402 Handle<ScopeInfo> Factory::NewScopeInfo(int length) {
1402 Handle<FixedArray> array = NewFixedArray(length, TENURED); 1403 Handle<FixedArray> array = NewFixedArray(length, TENURED);
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 } 2430 }
2430 2431
2431 2432
2432 Handle<Object> Factory::ToBoolean(bool value) { 2433 Handle<Object> Factory::ToBoolean(bool value) {
2433 return value ? true_value() : false_value(); 2434 return value ? true_value() : false_value();
2434 } 2435 }
2435 2436
2436 2437
2437 } // namespace internal 2438 } // namespace internal
2438 } // namespace v8 2439 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698