v8/test
vogelheim@chromium.org a42612b4a7 Change ScriptCompiler::CompileOptions to allow for two 'cache' modes
(parser or code) and to be explicit about cache consumption or production
(rather than making presence of cached_data imply one or the other.)

Also add a --cache flag to d8, to allow testing the functionality.

-----------------------------
API change

Reason: Currently, V8 supports a 'parser cache' for repeatedly executing the same script. We'd like to add a 2nd mode that would cache code, and would like to let the embedder decide which mode they chose (if any).

Note: Previously, the 'use cached data' property was implied by the presence of the cached data itself. (That is, kNoCompileOptions and source->cached_data != NULL.) That is no longer sufficient, since the presence of data is no longer sufficient to determine /which kind/ of data is present.

Changes from old behaviour:

- If you previously didn't use caching, nothing changes.
Example:
  v8::CompileUnbound(isolate, source, kNoCompileOptions);

- If you previously used caching, it worked like this:

  - 1st run:
  v8::CompileUnbound(isolate, source, kProduceToCache);
  Then, source->cached_data would contain the
  data-to-be cached. This remains the same, except you
  need to tell V8 which type of data you want.
  v8::CompileUnbound(isolate, source, kProduceParserCache);

  - 2nd run:
  v8::CompileUnbound(isolate, source, kNoCompileOptions);
  with source->cached_data set to the data you received in
  the first run. This will now ignore the cached data, and
  you need to explicitly tell V8 to use it:
  v8::CompileUnbound(isolate, source, kConsumeParserCache);
-----------------------------

BUG=
R=marja@chromium.org, yangguo@chromium.org

Review URL: https://codereview.chromium.org/389573006

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22431 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-07-16 12:18:33 +00:00
..
benchmarks Merge experimental/a64 to bleeding_edge. 2014-02-12 09:19:30 +00:00
cctest Change ScriptCompiler::CompileOptions to allow for two 'cache' modes 2014-07-16 12:18:33 +00:00
fuzz-natives Make fuzz-natives test generator more robust. 2014-07-09 11:39:22 +00:00
intl Store i18n meta data in hidden symbols instead of js accessible properties 2014-04-01 10:56:16 +00:00
message Clean up some A64 specific code in common code that was introduced by A64 merge 2014-02-12 13:27:13 +00:00
mjsunit Make ToPrimitive throw on symbol wrappers 2014-07-16 09:26:11 +00:00
mozilla This CL simplifies var / const by ensuring the behavior is consistent in itself, and with regular JS semantics; between regular var/const and eval-ed var/const. 2014-07-14 14:01:04 +00:00
preparser Throw syntax error when a getter/setter has the wrong number of params 2014-06-17 07:23:26 +00:00
promises-aplus Stop using urllib.urlretrieve() directly. 2014-05-21 09:25:05 +00:00
test262 Add mips64 port. 2014-07-09 11:08:26 +00:00
webkit Throw syntax error when a getter/setter has the wrong number of params 2014-06-17 07:23:26 +00:00