Skip to content

Commit

Permalink
Version 3.18.3
Browse files Browse the repository at this point in the history
Exposed the GC under a name that is less collision prone than window.gc. (issue 2641)

Do not emit double values at their use sites. (Chromium issue 234101)

Added methods to allow resuming execution after calling TerminateExecution(). (issue 2361)

Performance and stability improvements on all platforms.

git-svn-id: https://v8.googlecode.com/svn/trunk@14404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information
ulan@chromium.org committed Apr 24, 2013
1 parent e69e154 commit 0fa7573
Show file tree
Hide file tree
Showing 103 changed files with 2,264 additions and 1,953 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARM Ltd.
Hewlett-Packard Development Company, LP Hewlett-Packard Development Company, LP
Igalia, S.L. Igalia, S.L.
Joyent, Inc. Joyent, Inc.
Bloomberg Finance L.P.


Akinori MUSHA <knu@FreeBSD.org> Akinori MUSHA <knu@FreeBSD.org>
Alexander Botero-Lowry <alexbl@FreeBSD.org> Alexander Botero-Lowry <alexbl@FreeBSD.org>
Expand Down
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,16 @@
2013-04-24: Version 3.18.3

Exposed the GC under a name that is less collision prone than window.gc.
(issue 2641)

Do not emit double values at their use sites. (Chromium issue 234101)

Added methods to allow resuming execution after calling
TerminateExecution(). (issue 2361)

Performance and stability improvements on all platforms.


2013-04-22: Version 3.18.2 2013-04-22: Version 3.18.2


OS::MemMove/OS::MemCopy: Don't call through to generated code when size OS::MemMove/OS::MemCopy: Don't call through to generated code when size
Expand Down
69 changes: 6 additions & 63 deletions build/README.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,66 +1,9 @@
This directory contains the V8 GYP files used to generate actual project files For build instructions, please refer to:
for different build systems.


This is currently work in progress but this is expected to replace the SCons https://code.google.com/p/v8/wiki/BuildingWithGYP
based build system.


To use this a checkout of GYP is needed inside this directory. From the root of TL;DR version on *nix:
the V8 project do the following: $ make dependencies # Only needed once.
$ make ia32.release -j8
$ make ia32.release.check # Optionally: run tests.


$ svn co http://gyp.googlecode.com/svn/trunk build/gyp

Note for the command lines below that Debug is the default configuration,
so specifying that on the command lines is not required.


To generate Makefiles on Linux:
-------------------------------

$ build/gyp_v8

This will build makefiles for ia32, x64 and the ARM simulator with names
Makefile-ia32, Makefile-x64 and Makefile-armu respectively.

To build and run for ia32 in debug and release version do:

$ make -f Makefile-ia32
$ out/Debug/shell
$ make -f Makefile-ia32 BUILDTYPE=Release
$ out/Release/shell

Change the makefile to build and run for the other architectures.


To generate Xcode project files on Mac OS:
------------------------------------------

$ build/gyp_v8

This will make an Xcode project for the ia32 architecture. To build and run do:

$ xcodebuild -project build/all.xcodeproj
$ samples/build/Debug/shell
$ xcodebuild -project build/all.xcodeproj -configuration Release
$ samples/build/Release/shell


To generate Visual Studio solution and project files on Windows:
----------------------------------------------------------------

On Windows an additional third party component is required. This is cygwin in
the same version as is used by the Chromium project. This can be checked out
from the Chromium repository. From the root of the V8 project do the following:

> svn co http://src.chromium.org/svn/trunk/deps/third_party/cygwin@66844 third_party/cygwin

To run GYP Python is required and it is recommended to use the same version as
is used by the Chromium project. This can also be checked out from the Chromium
repository. From the root of the V8 project do the following:

> svn co http://src.chromium.org/svn/trunk/tools/third_party/python_26@89111 third_party/python_26

Now generate Visual Studio solution and project files for the ia32 architecture:

> third_party\python_26\python build/gyp_v8

Now open build\All.sln in Visual Studio.
6 changes: 2 additions & 4 deletions build/gyp_v8
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@


import glob import glob
import os import os
import platform
import shlex import shlex
import sys import sys


Expand All @@ -43,9 +44,6 @@ if __name__ == '__main__':
script_dir = os.path.dirname(__file__) script_dir = os.path.dirname(__file__)
v8_root = '.' v8_root = '.'


sys.path.insert(0, os.path.join(v8_root, 'tools'))
import utils

sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib')) sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib'))
import gyp import gyp


Expand Down Expand Up @@ -164,6 +162,6 @@ if __name__ == '__main__':


# Generate for the architectures supported on the given platform. # Generate for the architectures supported on the given platform.
gyp_args = list(args) gyp_args = list(args)
if utils.GuessOS() == 'linux': if platform.system() == 'Linux':
gyp_args.append('--generator-output=out') gyp_args.append('--generator-output=out')
run_gyp(gyp_args) run_gyp(gyp_args)
116 changes: 100 additions & 16 deletions include/v8.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1326,22 +1326,48 @@ class V8EXPORT String : public Primitive {


V8_INLINE(static String* Cast(v8::Value* obj)); V8_INLINE(static String* Cast(v8::Value* obj));


// TODO(dcarney): deprecate
/** /**
* Allocates a new string from either UTF-8 encoded or ASCII data. * Allocates a new string from either UTF-8 encoded or ASCII data.
* The second parameter 'length' gives the buffer length. If omitted, * The second parameter 'length' gives the buffer length. If omitted,
* the function calls 'strlen' to determine the buffer length. * the function calls 'strlen' to determine the buffer length.
*/ */
static Local<String> New(const char* data, int length = -1); V8_INLINE(static Local<String> New(const char* data, int length = -1));


// TODO(dcarney): deprecate
/** Allocates a new string from 16-bit character codes.*/ /** Allocates a new string from 16-bit character codes.*/
static Local<String> New(const uint16_t* data, int length = -1); V8_INLINE(static Local<String> New(const uint16_t* data, int length = -1));


// TODO(dcarney): deprecate
/** /**
* Creates an internalized string (historically called a "symbol", * Creates an internalized string (historically called a "symbol",
* not to be confused with ES6 symbols). Returns one if it exists already. * not to be confused with ES6 symbols). Returns one if it exists already.
* TODO(rossberg): Deprecate me when the new string API is here.
*/ */
static Local<String> NewSymbol(const char* data, int length = -1); V8_INLINE(static Local<String> NewSymbol(const char* data, int length = -1));

enum NewStringType {
kNormalString, kInternalizedString, kUndetectableString
};

/** Allocates a new string from UTF-8 data.*/
static Local<String> NewFromUtf8(Isolate* isolate,
const char* data,
NewStringType type = kNormalString,
int length = -1);

/** Allocates a new string from Latin-1 data.*/
static Local<String> NewFromOneByte(
Isolate* isolate,
const uint8_t* data,
NewStringType type = kNormalString,
int length = -1);

/** Allocates a new string from UTF-16 data.*/
static Local<String> NewFromTwoByte(
Isolate* isolate,
const uint16_t* data,
NewStringType type = kNormalString,
int length = -1);


/** /**
* Creates a new string by concatenating the left and the right strings * Creates a new string by concatenating the left and the right strings
Expand Down Expand Up @@ -1396,11 +1422,15 @@ class V8EXPORT String : public Primitive {
*/ */
bool CanMakeExternal(); bool CanMakeExternal();


// TODO(dcarney): deprecate
/** Creates an undetectable string from the supplied ASCII or UTF-8 data.*/ /** Creates an undetectable string from the supplied ASCII or UTF-8 data.*/
static Local<String> NewUndetectable(const char* data, int length = -1); V8_INLINE(
static Local<String> NewUndetectable(const char* data, int length = -1));


// TODO(dcarney): deprecate
/** Creates an undetectable string from the supplied 16-bit character codes.*/ /** Creates an undetectable string from the supplied 16-bit character codes.*/
static Local<String> NewUndetectable(const uint16_t* data, int length = -1); V8_INLINE(static Local<String> NewUndetectable(
const uint16_t* data, int length = -1));


/** /**
* Converts an object to a UTF-8-encoded character array. Useful if * Converts an object to a UTF-8-encoded character array. Useful if
Expand Down Expand Up @@ -3675,6 +3705,24 @@ class V8EXPORT V8 {
*/ */
static bool IsExecutionTerminating(Isolate* isolate = NULL); static bool IsExecutionTerminating(Isolate* isolate = NULL);


/**
* Resume execution capability in the given isolate, whose execution
* was previously forcefully terminated using TerminateExecution().
*
* When execution is forcefully terminated using TerminateExecution(),
* the isolate can not resume execution until all JavaScript frames
* have propagated the uncatchable exception which is generated. This
* method allows the program embedding the engine to handle the
* termination event and resume execution capability, even if
* JavaScript frames remain on the stack.
*
* This method can be used by any thread even if that thread has not
* acquired the V8 lock with a Locker object.
*
* \param isolate The isolate in which to resume execution capability.
*/
static void CancelTerminateExecution(Isolate* isolate);

/** /**
* Releases any resources used by v8 and stops any utility threads * Releases any resources used by v8 and stops any utility threads
* that may be running. Note that disposing v8 is permanent, it * that may be running. Note that disposing v8 is permanent, it
Expand Down Expand Up @@ -3785,20 +3833,29 @@ class V8EXPORT TryCatch {
bool HasCaught() const; bool HasCaught() const;


/** /**
* For certain types of exceptions, it makes no sense to continue * For certain types of exceptions, it makes no sense to continue execution.
* execution.
*
* Currently, the only type of exception that can be caught by a
* TryCatch handler and for which it does not make sense to continue
* is termination exception. Such exceptions are thrown when the
* TerminateExecution methods are called to terminate a long-running
* script.
* *
* If CanContinue returns false, the correct action is to perform * If CanContinue returns false, the correct action is to perform any C++
* any C++ cleanup needed and then return. * cleanup needed and then return. If CanContinue returns false and
* HasTerminated returns true, it is possible to call
* CancelTerminateExecution in order to continue calling into the engine.
*/ */
bool CanContinue() const; bool CanContinue() const;


/**
* Returns true if an exception has been caught due to script execution
* being terminated.
*
* There is no JavaScript representation of an execution termination
* exception. Such exceptions are thrown when the TerminateExecution
* methods are called to terminate a long-running script.
*
* If such an exception has been thrown, HasTerminated will return true,
* indicating that it is possible to call CancelTerminateExecution in order
* to continue calling into the engine.
*/
bool HasTerminated() const;

/** /**
* Throws the exception caught by this TryCatch in a way that avoids * Throws the exception caught by this TryCatch in a way that avoids
* it being caught again by this same TryCatch. As with ThrowException * it being caught again by this same TryCatch. As with ThrowException
Expand Down Expand Up @@ -3874,6 +3931,7 @@ class V8EXPORT TryCatch {
bool can_continue_ : 1; bool can_continue_ : 1;
bool capture_message_ : 1; bool capture_message_ : 1;
bool rethrow_ : 1; bool rethrow_ : 1;
bool has_terminated_ : 1;


friend class v8::internal::Isolate; friend class v8::internal::Isolate;
}; };
Expand Down Expand Up @@ -4839,6 +4897,32 @@ Local<String> String::Empty(Isolate* isolate) {
} }




Local<String> String::New(const char* data, int length) {
return NewFromUtf8(Isolate::GetCurrent(), data, kNormalString, length);
}


Local<String> String::New(const uint16_t* data, int length) {
return NewFromTwoByte(Isolate::GetCurrent(), data, kNormalString, length);
}


Local<String> String::NewSymbol(const char* data, int length) {
return NewFromUtf8(Isolate::GetCurrent(), data, kInternalizedString, length);
}


Local<String> String::NewUndetectable(const char* data, int length) {
return NewFromUtf8(Isolate::GetCurrent(), data, kUndetectableString, length);
}


Local<String> String::NewUndetectable(const uint16_t* data, int length) {
return NewFromTwoByte(
Isolate::GetCurrent(), data, kUndetectableString, length);
}


String::ExternalStringResource* String::GetExternalStringResource() const { String::ExternalStringResource* String::GetExternalStringResource() const {
typedef internal::Object O; typedef internal::Object O;
typedef internal::Internals I; typedef internal::Internals I;
Expand Down
Loading

0 comments on commit 0fa7573

Please sign in to comment.