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

Side by Side Diff: src/compilation-cache.cc

Issue 657077: Allow snapshots built without -DANDROID to work on Android.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/assembler.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 20 matching lines...) Expand all
31 #include "serialize.h" 31 #include "serialize.h"
32 32
33 namespace v8 { 33 namespace v8 {
34 namespace internal { 34 namespace internal {
35 35
36 36
37 // The number of sub caches covering the different types to cache. 37 // The number of sub caches covering the different types to cache.
38 static const int kSubCacheCount = 4; 38 static const int kSubCacheCount = 4;
39 39
40 // The number of generations for each sub cache. 40 // The number of generations for each sub cache.
41 #if defined(ANDROID)
42 static const int kScriptGenerations = 1;
43 static const int kEvalGlobalGenerations = 1;
44 static const int kEvalContextualGenerations = 1;
45 static const int kRegExpGenerations = 1;
46 #else
47 // The number of ScriptGenerations is carefully chosen based on histograms. 41 // The number of ScriptGenerations is carefully chosen based on histograms.
48 // See issue 458: http://code.google.com/p/v8/issues/detail?id=458 42 // See issue 458: http://code.google.com/p/v8/issues/detail?id=458
49 static const int kScriptGenerations = 5; 43 static const int kScriptGenerations = 5;
50 static const int kEvalGlobalGenerations = 2; 44 static const int kEvalGlobalGenerations = 2;
51 static const int kEvalContextualGenerations = 2; 45 static const int kEvalContextualGenerations = 2;
52 static const int kRegExpGenerations = 2; 46 static const int kRegExpGenerations = 2;
53 #endif
54 47
55 // Initial size of each compilation cache table allocated. 48 // Initial size of each compilation cache table allocated.
56 static const int kInitialCacheSize = 64; 49 static const int kInitialCacheSize = 64;
57 50
58 // The compilation cache consists of several generational sub-caches which uses 51 // The compilation cache consists of several generational sub-caches which uses
59 // this class as a base class. A sub-cache contains a compilation cache tables 52 // this class as a base class. A sub-cache contains a compilation cache tables
60 // for each generation of the sub-cache. Since the same source code string has 53 // for each generation of the sub-cache. Since the same source code string has
61 // different compiled code for scripts and evals, we use separate sub-caches 54 // different compiled code for scripts and evals, we use separate sub-caches
62 // for different compilation modes, to avoid retrieving the wrong result. 55 // for different compilation modes, to avoid retrieving the wrong result.
63 class CompilationSubCache { 56 class CompilationSubCache {
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } 475 }
483 476
484 477
485 void CompilationCache::Disable() { 478 void CompilationCache::Disable() {
486 enabled = false; 479 enabled = false;
487 Clear(); 480 Clear();
488 } 481 }
489 482
490 483
491 } } // namespace v8::internal 484 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698