Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Upgrade v8 to 3.9.17
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 13, 2012
1 parent bcb0cc0 commit e4fc2cb
Show file tree
Hide file tree
Showing 194 changed files with 11,152 additions and 4,857 deletions.
80 changes: 74 additions & 6 deletions deps/v8/ChangeLog
@@ -1,6 +1,74 @@
2012-03-12: Version 3.9.17

Fixed VFP detection through compiler defines. (issue 1996)

Add Code-related fields to postmortem metadata.

Performance and stability improvements on all platforms.


2012-03-09: Version 3.9.16

Added basic interface inference for modules (behind the --harmony flag).

Added Object.is, Number.isFinite, Number.isNaN.

Updated the Unicode tables to Unicode version 6.1.0.

Performance and stability improvements on all platforms.


2012-03-06: Version 3.9.15

Fix the heap profiler crash caused by memory layout changes between
passes.

Fix Error.prototype.toString to throw TypeError. (issue 1980)

Fix double-rounding in strtod for MinGW. (issue 1062)

Fix corrupted snapshot serializaton on ia32. (Chromium issue v8/1985)

Performance and stability improvements on all platforms.


2012-03-01: Version 3.9.14

Performance and stability improvements on all platforms.


2012-02-29: Version 3.9.13

Added code kind check before preparing for OSR. (issue 1900, 115073)

Fixed issue 1802: Pass zone explicitly to zone-allocation on x64 and
ARM.

Ported string construct stub to x64. (issue 849)

Performance and stability improvements on all platforms.


2012-02-28: Version 3.9.12

Fixed the negative lookup stub to handle deleted entries in a
dictionary. (issue 1964)

Added a new API where the host can supply a callback function. The
callback function can resolve the location of a return address on stack
to the location where a return-address rewriting profiler stashed the
original return address.

Fixed Chromium issue http://crbug.com/115646: When compiling for-in
pass correct context value to the increment instruction.

Fixed issue 1853: Update breakpoints set with partial file name after
compile.


2012-02-27: Version 3.9.11

Make 'module' a context-sensitive keyword (V8 issue 1957).
Made 'module' a context-sensitive keyword (V8 issue 1957).


2012-02-24: Version 3.9.10
Expand Down Expand Up @@ -55,11 +123,11 @@

2012-02-14: Version 3.9.6

Fix template-related linker error. (issue 1936)
Fixed template-related linker error. (issue 1936)

Allow inlining of functions containing object literals. (issue 1322)
Allowed inlining of functions containing object literals. (issue 1322)

Add --call-graph-size option to tickprocessor. (issue 1937)
Added --call-graph-size option to tickprocessor. (issue 1937)

Heap Snapshot maximum size limit is too low for really big apps. At the
moment the limit is 256MB. (Chromium issue 113015)
Expand Down Expand Up @@ -93,7 +161,7 @@

2012-02-06: Version 3.9.2

Add timestamp to --trace-gc output. (issue 1932)
Added timestamp to --trace-gc output. (issue 1932)

Heap profiler reports implicit references.

Expand All @@ -115,7 +183,7 @@

2012-02-01: Version 3.9.0

Reduce memory use immediately after starting V8.
Reduced memory use immediately after starting V8.

Stability fixes and performance improvements on all platforms.

Expand Down
4 changes: 4 additions & 0 deletions deps/v8/Makefile
Expand Up @@ -75,6 +75,10 @@ ifeq ($(vfp3), off)
else
GYPFLAGS += -Dv8_can_use_vfp_instructions=true
endif
# debuggersupport=off
ifeq ($(debuggersupport), off)
GYPFLAGS += -Dv8_enable_debugger_support=0
endif
# soname_version=1.2.3
ifdef soname_version
GYPFLAGS += -Dsoname_version=$(soname_version)
Expand Down
7 changes: 6 additions & 1 deletion deps/v8/SConstruct
Expand Up @@ -300,7 +300,12 @@ V8_EXTRA_FLAGS = {
'-Wnon-virtual-dtor']
},
'os:win32': {
'WARNINGFLAGS': ['-pedantic', '-Wno-long-long', '-Wno-pedantic-ms-format']
'WARNINGFLAGS': ['-pedantic',
'-Wno-long-long',
'-Wno-pedantic-ms-format'],
'library:shared': {
'LIBS': ['winmm', 'ws2_32']
}
},
'os:linux': {
'WARNINGFLAGS': ['-pedantic'],
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/build/common.gypi
Expand Up @@ -305,7 +305,7 @@
'cflags': [ '-I/usr/pkg/include' ],
}],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
'cflags': [ '-Wno-unused-parameter',
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
}],
],
Expand Down Expand Up @@ -352,6 +352,7 @@
}], # OS=="mac"
['OS=="win"', {
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1',
},
Expand Down
11 changes: 4 additions & 7 deletions deps/v8/include/v8-profiler.h
Expand Up @@ -284,14 +284,8 @@ class V8EXPORT HeapGraphNode {
* the objects that are reachable only from this object. In other
* words, the size of memory that will be reclaimed having this node
* collected.
*
* Exact retained size calculation has O(N) (number of nodes)
* computational complexity, while approximate has O(1). It is
* assumed that initially heap profiling tools provide approximate
* sizes for all nodes, and then exact sizes are calculated for the
* most 'interesting' nodes.
*/
int GetRetainedSize(bool exact) const;
int GetRetainedSize() const;

/** Returns child nodes count of the node. */
int GetChildrenCount() const;
Expand Down Expand Up @@ -436,6 +430,9 @@ class V8EXPORT HeapProfiler {
* handle.
*/
static const uint16_t kPersistentHandleNoClassId = 0;

/** Returns the number of currently existing persistent handles. */
static int GetPersistentHandleCount();
};


Expand Down
23 changes: 22 additions & 1 deletion deps/v8/include/v8.h
Expand Up @@ -2857,6 +2857,20 @@ class V8EXPORT StartupDataDecompressor { // NOLINT
typedef bool (*EntropySource)(unsigned char* buffer, size_t length);


/**
* ReturnAddressLocationResolver is used as a callback function when v8 is
* resolving the location of a return address on the stack. Profilers that
* change the return address on the stack can use this to resolve the stack
* location to whereever the profiler stashed the original return address.
* When invoked, return_addr_location will point to a location on stack where
* a machine return address resides, this function should return either the
* same pointer, or a pointer to the profiler's copy of the original return
* address.
*/
typedef uintptr_t (*ReturnAddressLocationResolver)(
uintptr_t return_addr_location);


/**
* Interface for iterating though all external resources in the heap.
*/
Expand Down Expand Up @@ -3110,6 +3124,13 @@ class V8EXPORT V8 {
*/
static void SetEntropySource(EntropySource source);

/**
* Allows the host application to provide a callback that allows v8 to
* cooperate with a profiler that rewrites return addresses on stack.
*/
static void SetReturnAddressLocationResolver(
ReturnAddressLocationResolver return_address_resolver);

/**
* Adjusts the amount of registered external memory. Used to give
* V8 an indication of the amount of externally allocated memory
Expand Down Expand Up @@ -3850,7 +3871,7 @@ class Internals {
static const int kFullStringRepresentationMask = 0x07;
static const int kExternalTwoByteRepresentationTag = 0x02;

static const int kJSObjectType = 0xa9;
static const int kJSObjectType = 0xaa;
static const int kFirstNonstringType = 0x80;
static const int kForeignType = 0x85;

Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/SConscript
Expand Up @@ -59,6 +59,7 @@ SOURCES = {
counters.cc
cpu-profiler.cc
data-flow.cc
date.cc
dateparser.cc
debug-agent.cc
debug.cc
Expand All @@ -84,6 +85,7 @@ SOURCES = {
hydrogen-instructions.cc
ic.cc
incremental-marking.cc
interface.cc
inspector.cc
interpreter-irregexp.cc
isolate.cc
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/allocation.h
Expand Up @@ -80,7 +80,7 @@ class AllStatic {


template <typename T>
T* NewArray(int size) {
T* NewArray(size_t size) {
T* result = new T[size];
if (result == NULL) Malloced::FatalProcessOutOfMemory();
return result;
Expand Down
28 changes: 21 additions & 7 deletions deps/v8/src/api.cc
Expand Up @@ -525,7 +525,8 @@ Extension::Extension(const char* name,
int source_length)
: name_(name),
source_length_(source_length >= 0 ?
source_length : (source ? strlen(source) : 0)),
source_length :
(source ? static_cast<int>(strlen(source)) : 0)),
source_(source, source_length_),
dep_count_(dep_count),
deps_(deps),
Expand Down Expand Up @@ -4026,6 +4027,12 @@ void v8::V8::SetEntropySource(EntropySource source) {
}


void v8::V8::SetReturnAddressLocationResolver(
ReturnAddressLocationResolver return_address_resolver) {
i::V8::SetReturnAddressLocationResolver(return_address_resolver);
}


bool v8::V8::Dispose() {
i::Isolate* isolate = i::Isolate::Current();
if (!ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(),
Expand Down Expand Up @@ -4728,8 +4735,8 @@ double v8::Date::NumberValue() const {
if (IsDeadCheck(isolate, "v8::Date::NumberValue()")) return 0;
LOG_API(isolate, "Date::NumberValue");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
i::Handle<i::JSValue> jsvalue = i::Handle<i::JSValue>::cast(obj);
return jsvalue->value()->Number();
i::Handle<i::JSDate> jsdate = i::Handle<i::JSDate>::cast(obj);
return jsdate->value()->Number();
}


Expand All @@ -4740,8 +4747,10 @@ void v8::Date::DateTimeConfigurationChangeNotification() {
LOG_API(isolate, "Date::DateTimeConfigurationChangeNotification");
ENTER_V8(isolate);

isolate->date_cache()->ResetDateCache();

i::HandleScope scope(isolate);
// Get the function ResetDateCache (defined in date-delay.js).
// Get the function ResetDateCache (defined in date.js).
i::Handle<i::String> func_name_str =
isolate->factory()->LookupAsciiSymbol("ResetDateCache");
i::MaybeObject* result =
Expand Down Expand Up @@ -5867,10 +5876,10 @@ int HeapGraphNode::GetSelfSize() const {
}


int HeapGraphNode::GetRetainedSize(bool exact) const {
int HeapGraphNode::GetRetainedSize() const {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapSnapshot::GetRetainedSize");
return ToInternal(this)->RetainedSize(exact);
return ToInternal(this)->retained_size();
}


Expand Down Expand Up @@ -5972,7 +5981,7 @@ const HeapGraphNode* HeapSnapshot::GetNodeById(uint64_t id) const {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapSnapshot::GetNodeById");
return reinterpret_cast<const HeapGraphNode*>(
ToInternal(this)->GetEntryById(id));
ToInternal(this)->GetEntryById(static_cast<i::SnapshotObjectId>(id)));
}


Expand Down Expand Up @@ -6065,6 +6074,11 @@ void HeapProfiler::DefineWrapperClass(uint16_t class_id,
}


int HeapProfiler::GetPersistentHandleCount() {
i::Isolate* isolate = i::Isolate::Current();
return isolate->global_handles()->NumberOfGlobalHandles();
}


v8::Testing::StressType internal::Testing::stress_type_ =
v8::Testing::kStressTypeOpt;
Expand Down
10 changes: 6 additions & 4 deletions deps/v8/src/arm/assembler-arm.cc
Expand Up @@ -66,11 +66,13 @@ static uint64_t CpuFeaturesImpliedByCompiler() {

#ifdef __arm__
// If the compiler is allowed to use VFP then we can use VFP too in our code
// generation even when generating snapshots. This won't work for cross
// compilation. VFPv3 implies ARMv7, see ARM DDI 0406B, page A1-6.
#if defined(__VFP_FP__) && !defined(__SOFTFP__)
// generation even when generating snapshots. ARMv7 and hardware floating
// point support implies VFPv3, see ARM DDI 0406B, page A1-6.
#if defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(__VFP_FP__) \
&& !defined(__SOFTFP__)
answer |= 1u << VFP3 | 1u << ARMv7;
#endif // defined(__VFP_FP__) && !defined(__SOFTFP__)
#endif // defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(__VFP_FP__)
// && !defined(__SOFTFP__)
#endif // def __arm__

return answer;
Expand Down
7 changes: 7 additions & 0 deletions deps/v8/src/arm/builtins-arm.cc
Expand Up @@ -978,6 +978,11 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
NullCallWrapper(), CALL_AS_METHOD);
}

// Store offset of return address for deoptimizer.
if (!is_api_function && !count_constructions) {
masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset());
}

// Restore context from the frame.
// r0: result
// sp[0]: receiver
Expand Down Expand Up @@ -1740,7 +1745,9 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
__ bind(&invoke);
__ Call(r3);

// Store offset of return address for deoptimizer.
masm->isolate()->heap()->SetArgumentsAdaptorDeoptPCOffset(masm->pc_offset());

// Exit frame and return.
LeaveArgumentsAdaptorFrame(masm);
__ Jump(lr);
Expand Down

0 comments on commit e4fc2cb

Please sign in to comment.