Skip to content

Commit 564a486

Browse files
committed
Upgrade V8 to 2.5.6
1 parent d4af8a6 commit 564a486

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+6813
-2691
lines changed

deps/v8/AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARM Ltd.
99
Hewlett-Packard Development Company, LP
1010

1111
Alexander Botero-Lowry <[email protected]>
12+
Alexandre Rames <[email protected]>
1213
Alexandre Vassalotti <[email protected]>
1314
Andreas Anyuru <[email protected]>
1415
Burcu Dogan <[email protected]>

deps/v8/ChangeLog

+23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
2010-11-10: Version 2.5.6
2+
3+
Added support for VFP rounding modes to the ARM simulator.
4+
5+
Fixed multiplication overflow bug (issue 927).
6+
7+
Added a limit for the amount of executable memory (issue 925).
8+
9+
10+
2010-11-08: Version 2.5.5
11+
12+
Added more aggressive GC of external objects in near out-of-memory
13+
situations.
14+
15+
Fixed a bug that gave the incorrect result for String.split called
16+
on the empty string (issue 924).
17+
18+
19+
2010-11-03: Version 2.5.4
20+
21+
Improved V8 VFPv3 runtime detection to address issue 914.
22+
23+
124
2010-11-01: Version 2.5.3
225

326
Fixed a bug that prevents constants from overwriting function values

deps/v8/include/v8-debug.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class EXPORT Debug {
142142

143143
virtual ~Message() {}
144144
};
145-
145+
146146

147147
/**
148148
* An event details object passed to the debug event listener.
@@ -300,7 +300,7 @@ class EXPORT Debug {
300300
* get access to information otherwise not available during normal JavaScript
301301
* execution e.g. details on stack frames. Receiver of the function call will
302302
* be the debugger context global object, however this is a subject to change.
303-
* The following example show a JavaScript function which when passed to
303+
* The following example show a JavaScript function which when passed to
304304
* v8::Debug::Call will return the current line of JavaScript execution.
305305
*
306306
* \code

deps/v8/include/v8.h

+28-36
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,9 @@
3838
#ifndef V8_H_
3939
#define V8_H_
4040

41-
#include <stdio.h>
41+
#include "v8stdint.h"
4242

4343
#ifdef _WIN32
44-
// When compiling on MinGW stdint.h is available.
45-
#ifdef __MINGW32__
46-
#include <stdint.h>
47-
#else // __MINGW32__
48-
typedef signed char int8_t;
49-
typedef unsigned char uint8_t;
50-
typedef short int16_t; // NOLINT
51-
typedef unsigned short uint16_t; // NOLINT
52-
typedef int int32_t;
53-
typedef unsigned int uint32_t;
54-
typedef __int64 int64_t;
55-
typedef unsigned __int64 uint64_t;
56-
// intptr_t and friends are defined in crtdefs.h through stdio.h.
57-
#endif // __MINGW32__
5844

5945
// Setup for Windows DLL export/import. When building the V8 DLL the
6046
// BUILDING_V8_SHARED needs to be defined. When building a program which uses
@@ -76,8 +62,6 @@ typedef unsigned __int64 uint64_t;
7662

7763
#else // _WIN32
7864

79-
#include <stdint.h>
80-
8165
// Setup for Linux shared library export. There is no need to distinguish
8266
// between building or using the V8 shared library, but we should not
8367
// export symbols when we are building a static library.
@@ -127,7 +111,6 @@ class Arguments;
127111
class Object;
128112
class Heap;
129113
class Top;
130-
131114
}
132115

133116

@@ -476,10 +459,10 @@ class V8EXPORT HandleScope {
476459
level = 0;
477460
}
478461
};
479-
462+
480463
void Leave();
481464

482-
465+
483466
internal::Object** prev_next_;
484467
internal::Object** prev_limit_;
485468

@@ -1055,7 +1038,7 @@ class String : public Primitive {
10551038
*/
10561039
V8EXPORT bool IsExternalAscii() const;
10571040

1058-
class V8EXPORT ExternalStringResourceBase {
1041+
class V8EXPORT ExternalStringResourceBase { // NOLINT
10591042
public:
10601043
virtual ~ExternalStringResourceBase() {}
10611044

@@ -2365,12 +2348,15 @@ class V8EXPORT ResourceConstraints {
23652348
void set_max_young_space_size(int value) { max_young_space_size_ = value; }
23662349
int max_old_space_size() const { return max_old_space_size_; }
23672350
void set_max_old_space_size(int value) { max_old_space_size_ = value; }
2351+
int max_executable_size() { return max_executable_size_; }
2352+
void set_max_executable_size(int value) { max_executable_size_ = value; }
23682353
uint32_t* stack_limit() const { return stack_limit_; }
23692354
// Sets an address beyond which the VM's stack may not grow.
23702355
void set_stack_limit(uint32_t* value) { stack_limit_ = value; }
23712356
private:
23722357
int max_young_space_size_;
23732358
int max_old_space_size_;
2359+
int max_executable_size_;
23742360
uint32_t* stack_limit_;
23752361
};
23762362

@@ -2502,13 +2488,18 @@ class V8EXPORT HeapStatistics {
25022488
public:
25032489
HeapStatistics();
25042490
size_t total_heap_size() { return total_heap_size_; }
2491+
size_t total_heap_size_executable() { return total_heap_size_executable_; }
25052492
size_t used_heap_size() { return used_heap_size_; }
25062493

25072494
private:
25082495
void set_total_heap_size(size_t size) { total_heap_size_ = size; }
2496+
void set_total_heap_size_executable(size_t size) {
2497+
total_heap_size_executable_ = size;
2498+
}
25092499
void set_used_heap_size(size_t size) { used_heap_size_ = size; }
25102500

25112501
size_t total_heap_size_;
2502+
size_t total_heap_size_executable_;
25122503
size_t used_heap_size_;
25132504

25142505
friend class V8;
@@ -3260,8 +3251,8 @@ class V8EXPORT Locker {
32603251
/**
32613252
* An interface for exporting data from V8, using "push" model.
32623253
*/
3263-
class V8EXPORT OutputStream {
3264-
public:
3254+
class V8EXPORT OutputStream { // NOLINT
3255+
public:
32653256
enum OutputEncoding {
32663257
kAscii = 0 // 7-bit ASCII.
32673258
};
@@ -3291,6 +3282,8 @@ class V8EXPORT OutputStream {
32913282

32923283
namespace internal {
32933284

3285+
const int kPointerSize = sizeof(void*); // NOLINT
3286+
const int kIntSize = sizeof(int); // NOLINT
32943287

32953288
// Tag information for HeapObject.
32963289
const int kHeapObjectTag = 1;
@@ -3326,19 +3319,19 @@ template <> struct SmiConstants<8> {
33263319
}
33273320
};
33283321

3329-
const int kSmiShiftSize = SmiConstants<sizeof(void*)>::kSmiShiftSize;
3330-
const int kSmiValueSize = SmiConstants<sizeof(void*)>::kSmiValueSize;
3322+
const int kSmiShiftSize = SmiConstants<kPointerSize>::kSmiShiftSize;
3323+
const int kSmiValueSize = SmiConstants<kPointerSize>::kSmiValueSize;
33313324

33323325
template <size_t ptr_size> struct InternalConstants;
33333326

33343327
// Internal constants for 32-bit systems.
33353328
template <> struct InternalConstants<4> {
3336-
static const int kStringResourceOffset = 3 * sizeof(void*);
3329+
static const int kStringResourceOffset = 3 * kPointerSize;
33373330
};
33383331

33393332
// Internal constants for 64-bit systems.
33403333
template <> struct InternalConstants<8> {
3341-
static const int kStringResourceOffset = 3 * sizeof(void*);
3334+
static const int kStringResourceOffset = 3 * kPointerSize;
33423335
};
33433336

33443337
/**
@@ -3352,12 +3345,12 @@ class Internals {
33523345
// These values match non-compiler-dependent values defined within
33533346
// the implementation of v8.
33543347
static const int kHeapObjectMapOffset = 0;
3355-
static const int kMapInstanceTypeOffset = sizeof(void*) + sizeof(int);
3348+
static const int kMapInstanceTypeOffset = kPointerSize + kIntSize;
33563349
static const int kStringResourceOffset =
3357-
InternalConstants<sizeof(void*)>::kStringResourceOffset;
3350+
InternalConstants<kPointerSize>::kStringResourceOffset;
33583351

3359-
static const int kProxyProxyOffset = sizeof(void*);
3360-
static const int kJSObjectHeaderSize = 3 * sizeof(void*);
3352+
static const int kProxyProxyOffset = kPointerSize;
3353+
static const int kJSObjectHeaderSize = 3 * kPointerSize;
33613354
static const int kFullStringRepresentationMask = 0x07;
33623355
static const int kExternalTwoByteRepresentationTag = 0x02;
33633356

@@ -3375,7 +3368,7 @@ class Internals {
33753368
}
33763369

33773370
static inline int SmiValue(internal::Object* value) {
3378-
return SmiConstants<sizeof(void*)>::SmiToInt(value);
3371+
return SmiConstants<kPointerSize>::SmiToInt(value);
33793372
}
33803373

33813374
static inline int GetInstanceType(internal::Object* obj) {
@@ -3404,10 +3397,9 @@ class Internals {
34043397
uint8_t* addr = reinterpret_cast<uint8_t*>(ptr) + offset - kHeapObjectTag;
34053398
return *reinterpret_cast<T*>(addr);
34063399
}
3407-
34083400
};
34093401

3410-
}
3402+
} // namespace internal
34113403

34123404

34133405
template <class T>
@@ -3567,7 +3559,7 @@ Local<Value> Object::UncheckedGetInternalField(int index) {
35673559
// If the object is a plain JSObject, which is the common case,
35683560
// we know where to find the internal fields and can return the
35693561
// value directly.
3570-
int offset = I::kJSObjectHeaderSize + (sizeof(void*) * index);
3562+
int offset = I::kJSObjectHeaderSize + (internal::kPointerSize * index);
35713563
O* value = I::ReadField<O*>(obj, offset);
35723564
O** result = HandleScope::CreateHandle(value);
35733565
return Local<Value>(reinterpret_cast<Value*>(result));
@@ -3603,7 +3595,7 @@ void* Object::GetPointerFromInternalField(int index) {
36033595
// If the object is a plain JSObject, which is the common case,
36043596
// we know where to find the internal fields and can return the
36053597
// value directly.
3606-
int offset = I::kJSObjectHeaderSize + (sizeof(void*) * index);
3598+
int offset = I::kJSObjectHeaderSize + (internal::kPointerSize * index);
36073599
O* value = I::ReadField<O*>(obj, offset);
36083600
return I::GetExternalPointer(value);
36093601
}

deps/v8/include/v8stdint.h

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright 2010 the V8 project authors. All rights reserved.
2+
// Redistribution and use in source and binary forms, with or without
3+
// modification, are permitted provided that the following conditions are
4+
// met:
5+
//
6+
// * Redistributions of source code must retain the above copyright
7+
// notice, this list of conditions and the following disclaimer.
8+
// * Redistributions in binary form must reproduce the above
9+
// copyright notice, this list of conditions and the following
10+
// disclaimer in the documentation and/or other materials provided
11+
// with the distribution.
12+
// * Neither the name of Google Inc. nor the names of its
13+
// contributors may be used to endorse or promote products derived
14+
// from this software without specific prior written permission.
15+
//
16+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
28+
// Load definitions of standard types.
29+
30+
#ifndef V8STDINT_H_
31+
#define V8STDINT_H_
32+
33+
#include <stdio.h>
34+
35+
#if defined(_WIN32) && !defined(__MINGW32__)
36+
37+
typedef signed char int8_t;
38+
typedef unsigned char uint8_t;
39+
typedef short int16_t; // NOLINT
40+
typedef unsigned short uint16_t; // NOLINT
41+
typedef int int32_t;
42+
typedef unsigned int uint32_t;
43+
typedef __int64 int64_t;
44+
typedef unsigned __int64 uint64_t;
45+
// intptr_t and friends are defined in crtdefs.h through stdio.h.
46+
47+
#else
48+
49+
#include <stdint.h>
50+
51+
#endif
52+
53+
#endif // V8STDINT_H_

deps/v8/src/SConscript

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ SOURCES = {
4040
api.cc
4141
assembler.cc
4242
ast.cc
43+
bignum.cc
4344
bootstrapper.cc
4445
builtins.cc
4546
cached-powers.cc
@@ -95,6 +96,7 @@ SOURCES = {
9596
register-allocator.cc
9697
rewriter.cc
9798
runtime.cc
99+
scanner-base.cc
98100
scanner.cc
99101
scopeinfo.cc
100102
scopes.cc

deps/v8/src/api.cc

+11-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "serialize.h"
4444
#include "snapshot.h"
4545
#include "top.h"
46-
#include "utils.h"
4746
#include "v8threads.h"
4847
#include "version.h"
4948

@@ -394,14 +393,18 @@ v8::Handle<Boolean> False() {
394393
ResourceConstraints::ResourceConstraints()
395394
: max_young_space_size_(0),
396395
max_old_space_size_(0),
396+
max_executable_size_(0),
397397
stack_limit_(NULL) { }
398398

399399

400400
bool SetResourceConstraints(ResourceConstraints* constraints) {
401401
int young_space_size = constraints->max_young_space_size();
402402
int old_gen_size = constraints->max_old_space_size();
403-
if (young_space_size != 0 || old_gen_size != 0) {
404-
bool result = i::Heap::ConfigureHeap(young_space_size / 2, old_gen_size);
403+
int max_executable_size = constraints->max_executable_size();
404+
if (young_space_size != 0 || old_gen_size != 0 || max_executable_size != 0) {
405+
bool result = i::Heap::ConfigureHeap(young_space_size / 2,
406+
old_gen_size,
407+
max_executable_size);
405408
if (!result) return false;
406409
}
407410
if (constraints->stack_limit() != NULL) {
@@ -3260,11 +3263,15 @@ bool v8::V8::Dispose() {
32603263
}
32613264

32623265

3263-
HeapStatistics::HeapStatistics(): total_heap_size_(0), used_heap_size_(0) { }
3266+
HeapStatistics::HeapStatistics(): total_heap_size_(0),
3267+
total_heap_size_executable_(0),
3268+
used_heap_size_(0) { }
32643269

32653270

32663271
void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) {
32673272
heap_statistics->set_total_heap_size(i::Heap::CommittedMemory());
3273+
heap_statistics->set_total_heap_size_executable(
3274+
i::Heap::CommittedMemoryExecutable());
32683275
heap_statistics->set_used_heap_size(i::Heap::SizeOfObjects());
32693276
}
32703277

0 commit comments

Comments
 (0)