Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into object-observe
Browse files Browse the repository at this point in the history
  • Loading branch information
ajklein committed Oct 24, 2012
2 parents 6f52553 + de6b563 commit 9001dc0
Show file tree
Hide file tree
Showing 103 changed files with 2,383 additions and 527 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Expand Up @@ -25,8 +25,8 @@ shell_g
/build/Debug /build/Debug
/build/gyp /build/gyp
/build/Release /build/Release
/obj/ /obj
/out/ /out
/test/cctest/cctest.status2 /test/cctest/cctest.status2
/test/es5conform/data /test/es5conform/data
/test/message/message.status2 /test/message/message.status2
Expand All @@ -47,6 +47,6 @@ shell_g
/tools/oom_dump/oom_dump.o /tools/oom_dump/oom_dump.o
/tools/visual_studio/Debug /tools/visual_studio/Debug
/tools/visual_studio/Release /tools/visual_studio/Release
/xcodebuild/ /xcodebuild
TAGS TAGS
*.Makefile *.Makefile
21 changes: 21 additions & 0 deletions ChangeLog
@@ -1,3 +1,24 @@
2012-10-22: Version 3.14.5

Killed off the SCons based build.

Added a faster API for creating v8::Integer objects.

Speeded up function deoptimization by avoiding quadratic pass over
optimized function list. (Chromium issue 155270)

Always invoke the default Array.sort functions from builtin functions.
(issue 2372)

Reverted recent CPU profiler changes because they broke --prof.
(issue 2364)

Switched code flushing to use different JSFunction field.
(issue 1609)

Performance and stability improvements on all platforms.


2012-10-15: Version 3.14.4 2012-10-15: Version 3.14.4


Allow evals for debugger even if they are prohibited in the debugee Allow evals for debugger even if they are prohibited in the debugee
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Expand Up @@ -30,7 +30,7 @@
CXX ?= g++ CXX ?= g++
LINK ?= g++ LINK ?= g++
OUTDIR ?= out OUTDIR ?= out
TESTJOBS ?= -j16 TESTJOBS ?=
GYPFLAGS ?= GYPFLAGS ?=
TESTFLAGS ?= TESTFLAGS ?=
ANDROID_NDK_ROOT ?= ANDROID_NDK_ROOT ?=
Expand Down Expand Up @@ -83,9 +83,9 @@ ifeq ($(liveobjectlist), on)
endif endif
# vfp3=off # vfp3=off
ifeq ($(vfp3), off) ifeq ($(vfp3), off)
GYPFLAGS += -Dv8_can_use_vfp_instructions=false GYPFLAGS += -Dv8_can_use_vfp3_instructions=false
else else
GYPFLAGS += -Dv8_can_use_vfp_instructions=true GYPFLAGS += -Dv8_can_use_vfp3_instructions=true
endif endif
# debuggersupport=off # debuggersupport=off
ifeq ($(debuggersupport), off) ifeq ($(debuggersupport), off)
Expand Down Expand Up @@ -203,37 +203,37 @@ $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \


# Test targets. # Test targets.
check: all check: all
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
$(TESTFLAGS) $(TESTFLAGS)


$(addsuffix .check,$(MODES)): $$(basename $$@) $(addsuffix .check,$(MODES)): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
--mode=$(basename $@) $(TESTFLAGS) --mode=$(basename $@) $(TESTFLAGS)


$(addsuffix .check,$(ARCHES)): $$(basename $$@) $(addsuffix .check,$(ARCHES)): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(basename $@) $(TESTFLAGS) --arch=$(basename $@) $(TESTFLAGS)


$(CHECKS): $$(basename $$@) $(CHECKS): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) $(TESTFLAGS) --arch-and-mode=$(basename $@) $(TESTFLAGS)


$(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
@tools/android-sync.sh $(basename $@) $(OUTDIR) \ @tools/android-sync.sh $(basename $@) $(OUTDIR) \
$(shell pwd) $(ANDROID_V8) $(shell pwd) $(ANDROID_V8)


$(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) \ --arch-and-mode=$(basename $@) \
--timeout=600 \ --timeout=600 \
--special-command="tools/android-run.py @" --command-prefix="tools/android-run.py"


$(addsuffix .check, $(ANDROID_ARCHES)): \ $(addsuffix .check, $(ANDROID_ARCHES)): \
$(addprefix $$(basename $$@).,$(MODES)).check $(addprefix $$(basename $$@).,$(MODES)).check


native.check: native native.check: native
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
--arch-and-mode=. $(TESTFLAGS) --arch-and-mode=. $(TESTFLAGS)


# Clean targets. You can clean each architecture individually, or everything. # Clean targets. You can clean each architecture individually, or everything.
Expand Down
47 changes: 33 additions & 14 deletions SConstruct
Expand Up @@ -1157,6 +1157,11 @@ SIMPLE_OPTIONS = {
'default': 'on', 'default': 'on',
'help': 'use fpu instructions when building the snapshot [MIPS only]' 'help': 'use fpu instructions when building the snapshot [MIPS only]'
}, },
'I_know_I_should_build_with_GYP': {
'values': ['yes', 'no'],
'default': 'no',
'help': 'grace period: temporarily override SCons deprecation'
}


} }


Expand Down Expand Up @@ -1257,7 +1262,35 @@ def IsLegal(env, option, values):
return True return True




def WarnAboutDeprecation():
print """
#####################################################################
# #
# LAST WARNING: Building V8 with SCons is deprecated. #
# #
# This only works because you have overridden the kill switch. #
# #
# MIGRATE TO THE GYP-BASED BUILD NOW! #
# #
# Instructions: http://code.google.com/p/v8/wiki/BuildingWithGYP. #
# #
#####################################################################
"""


def VerifyOptions(env): def VerifyOptions(env):
if env['I_know_I_should_build_with_GYP'] != 'yes':
Abort("Building V8 with SCons is no longer supported. Please use GYP "
"instead; you can find instructions are at "
"http://code.google.com/p/v8/wiki/BuildingWithGYP.\n\n"
"Quitting.\n\n"
"For a limited grace period, you can specify "
"\"I_know_I_should_build_with_GYP=yes\" to override.")
else:
WarnAboutDeprecation()
import atexit
atexit.register(WarnAboutDeprecation)

if not IsLegal(env, 'mode', ['debug', 'release']): if not IsLegal(env, 'mode', ['debug', 'release']):
return False return False
if not IsLegal(env, 'sample', ["shell", "process", "lineprocessor"]): if not IsLegal(env, 'sample', ["shell", "process", "lineprocessor"]):
Expand Down Expand Up @@ -1600,18 +1633,4 @@ try:
except: except:
pass pass



def WarnAboutDeprecation():
print """
#######################################################
# WARNING: Building V8 with SCons is deprecated and #
# will not work much longer. Please switch to using #
# the GYP-based build now. Instructions are at #
# http://code.google.com/p/v8/wiki/BuildingWithGYP. #
#######################################################
"""

WarnAboutDeprecation()
import atexit
atexit.register(WarnAboutDeprecation)
Build() Build()
1 change: 0 additions & 1 deletion build/common.gypi
Expand Up @@ -357,7 +357,6 @@
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', { ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter', 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ], '-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
}], }],
['OS=="android"', { ['OS=="android"', {
'variables': { 'variables': {
Expand Down
64 changes: 53 additions & 11 deletions include/v8.h
Expand Up @@ -390,7 +390,7 @@ template <class T> class Persistent : public Handle<T> {
*/ */
inline void MakeWeak(void* parameters, WeakReferenceCallback callback); inline void MakeWeak(void* parameters, WeakReferenceCallback callback);


/** Clears the weak reference to this object.*/ /** Clears the weak reference to this object. */
inline void ClearWeak(); inline void ClearWeak();


/** /**
Expand All @@ -402,14 +402,13 @@ template <class T> class Persistent : public Handle<T> {
*/ */
inline void MarkIndependent(); inline void MarkIndependent();


/** /** Returns true if this handle was previously marked as independent. */
*Checks if the handle holds the only reference to an object. inline bool IsIndependent() const;
*/
/** Checks if the handle holds the only reference to an object. */
inline bool IsNearDeath() const; inline bool IsNearDeath() const;


/** /** Returns true if the handle's reference is weak. */
* Returns true if the handle's reference is weak.
*/
inline bool IsWeak() const; inline bool IsWeak() const;


/** /**
Expand All @@ -418,6 +417,12 @@ template <class T> class Persistent : public Handle<T> {
*/ */
inline void SetWrapperClassId(uint16_t class_id); inline void SetWrapperClassId(uint16_t class_id);


/**
* Returns the class ID previously assigned to this handle or 0 if no class
* ID was previously assigned.
*/
inline uint16_t WrapperClassId() const;

private: private:
friend class ImplementationUtilities; friend class ImplementationUtilities;
friend class ObjectTemplate; friend class ObjectTemplate;
Expand Down Expand Up @@ -1384,6 +1389,8 @@ class Integer : public Number {
public: public:
V8EXPORT static Local<Integer> New(int32_t value); V8EXPORT static Local<Integer> New(int32_t value);
V8EXPORT static Local<Integer> NewFromUnsigned(uint32_t value); V8EXPORT static Local<Integer> NewFromUnsigned(uint32_t value);
V8EXPORT static Local<Integer> New(int32_t value, Isolate*);
V8EXPORT static Local<Integer> NewFromUnsigned(uint32_t value, Isolate*);
V8EXPORT int64_t Value() const; V8EXPORT int64_t Value() const;
static inline Integer* Cast(v8::Value* obj); static inline Integer* Cast(v8::Value* obj);
private: private:
Expand Down Expand Up @@ -2653,7 +2660,7 @@ bool V8EXPORT SetResourceConstraints(ResourceConstraints* constraints);
typedef void (*FatalErrorCallback)(const char* location, const char* message); typedef void (*FatalErrorCallback)(const char* location, const char* message);




typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> data); typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error);




/** /**
Expand Down Expand Up @@ -2766,6 +2773,7 @@ class V8EXPORT HeapStatistics {
HeapStatistics(); HeapStatistics();
size_t total_heap_size() { return total_heap_size_; } size_t total_heap_size() { return total_heap_size_; }
size_t total_heap_size_executable() { return total_heap_size_executable_; } size_t total_heap_size_executable() { return total_heap_size_executable_; }
size_t total_physical_size() { return total_physical_size_; }
size_t used_heap_size() { return used_heap_size_; } size_t used_heap_size() { return used_heap_size_; }
size_t heap_size_limit() { return heap_size_limit_; } size_t heap_size_limit() { return heap_size_limit_; }


Expand All @@ -2774,11 +2782,15 @@ class V8EXPORT HeapStatistics {
void set_total_heap_size_executable(size_t size) { void set_total_heap_size_executable(size_t size) {
total_heap_size_executable_ = size; total_heap_size_executable_ = size;
} }
void set_total_physical_size(size_t size) {
total_physical_size_ = size;
}
void set_used_heap_size(size_t size) { used_heap_size_ = size; } void set_used_heap_size(size_t size) { used_heap_size_ = size; }
void set_heap_size_limit(size_t size) { heap_size_limit_ = size; } void set_heap_size_limit(size_t size) { heap_size_limit_ = size; }


size_t total_heap_size_; size_t total_heap_size_;
size_t total_heap_size_executable_; size_t total_heap_size_executable_;
size_t total_physical_size_;
size_t used_heap_size_; size_t used_heap_size_;
size_t heap_size_limit_; size_t heap_size_limit_;


Expand Down Expand Up @@ -3011,7 +3023,7 @@ typedef void (*JitCodeEventHandler)(const JitCodeEvent* event);




/** /**
* Interface for iterating though all external resources in the heap. * Interface for iterating through all external resources in the heap.
*/ */
class V8EXPORT ExternalResourceVisitor { // NOLINT class V8EXPORT ExternalResourceVisitor { // NOLINT
public: public:
Expand All @@ -3020,6 +3032,17 @@ class V8EXPORT ExternalResourceVisitor { // NOLINT
}; };




/**
* Interface for iterating through all the persistent handles in the heap.
*/
class V8EXPORT PersistentHandleVisitor { // NOLINT
public:
virtual ~PersistentHandleVisitor() {}
virtual void VisitPersistentHandle(Persistent<Value> value,
uint16_t class_id) {}
};


/** /**
* Container class for static utility functions. * Container class for static utility functions.
*/ */
Expand Down Expand Up @@ -3085,8 +3108,7 @@ class V8EXPORT V8 {
* The same message listener can be added more than once and in that * The same message listener can be added more than once and in that
* case it will be called more than once for each message. * case it will be called more than once for each message.
*/ */
static bool AddMessageListener(MessageCallback that, static bool AddMessageListener(MessageCallback that);
Handle<Value> data = Handle<Value>());


/** /**
* Remove all message listeners from the specified callback function. * Remove all message listeners from the specified callback function.
Expand Down Expand Up @@ -3427,6 +3449,12 @@ class V8EXPORT V8 {
*/ */
static void VisitExternalResources(ExternalResourceVisitor* visitor); static void VisitExternalResources(ExternalResourceVisitor* visitor);


/**
* Iterates through all the persistent handles in the current isolate's heap
* that have class_ids.
*/
static void VisitHandlesWithClassIds(PersistentHandleVisitor* visitor);

/** /**
* Optional notification that the embedder is idle. * Optional notification that the embedder is idle.
* V8 uses the notification to reduce memory footprint. * V8 uses the notification to reduce memory footprint.
Expand Down Expand Up @@ -3467,10 +3495,12 @@ class V8EXPORT V8 {
WeakReferenceCallback); WeakReferenceCallback);
static void ClearWeak(internal::Object** global_handle); static void ClearWeak(internal::Object** global_handle);
static void MarkIndependent(internal::Object** global_handle); static void MarkIndependent(internal::Object** global_handle);
static bool IsGlobalIndependent(internal::Object** global_handle);
static bool IsGlobalNearDeath(internal::Object** global_handle); static bool IsGlobalNearDeath(internal::Object** global_handle);
static bool IsGlobalWeak(internal::Object** global_handle); static bool IsGlobalWeak(internal::Object** global_handle);
static void SetWrapperClassId(internal::Object** global_handle, static void SetWrapperClassId(internal::Object** global_handle,
uint16_t class_id); uint16_t class_id);
static uint16_t GetWrapperClassId(internal::Object** global_handle);


template <class T> friend class Handle; template <class T> friend class Handle;
template <class T> friend class Local; template <class T> friend class Local;
Expand Down Expand Up @@ -4187,6 +4217,13 @@ Persistent<T> Persistent<T>::New(Handle<T> that) {
} }




template <class T>
bool Persistent<T>::IsIndependent() const {
if (this->IsEmpty()) return false;
return V8::IsGlobalIndependent(reinterpret_cast<internal::Object**>(**this));
}


template <class T> template <class T>
bool Persistent<T>::IsNearDeath() const { bool Persistent<T>::IsNearDeath() const {
if (this->IsEmpty()) return false; if (this->IsEmpty()) return false;
Expand Down Expand Up @@ -4233,6 +4270,11 @@ void Persistent<T>::SetWrapperClassId(uint16_t class_id) {
V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id);
} }


template <class T>
uint16_t Persistent<T>::WrapperClassId() const {
return V8::GetWrapperClassId(reinterpret_cast<internal::Object**>(**this));
}

Arguments::Arguments(internal::Object** implicit_args, Arguments::Arguments(internal::Object** implicit_args,
internal::Object** values, int length, internal::Object** values, int length,
bool is_construct_call) bool is_construct_call)
Expand Down

0 comments on commit 9001dc0

Please sign in to comment.