Skip to content

Commit e4eeaa7

Browse files
committed
Upgrade V8 to 2.3.2
1 parent 07ab34c commit e4eeaa7

62 files changed

Lines changed: 2154 additions & 666 deletions

Some content is hidden

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

deps/v8/ChangeLog

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2010-07-21: Version 2.3.2
2+
3+
Fixed compiler warnings when building with LLVM.
4+
5+
Fixed a bug with for-in applied to strings (issue 785).
6+
7+
Performance improvements on all platforms.
8+
9+
2010-07-19: Version 2.3.1
10+
11+
Fixed compilation and linking with V8_INTERPRETED_REGEXP flag.
12+
13+
Fixed bug related to code flushing while compiling a lazy
14+
compilable function (issue http://crbug.com/49099).
15+
16+
Performance improvements on all platforms.
17+
18+
119
2010-07-15: Version 2.3.0
220

321
Added ES5 Object.seal and Object.isSealed.

deps/v8/SConstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ V8_EXTRA_FLAGS = {
300300
'gcc': {
301301
'all': {
302302
'WARNINGFLAGS': ['-Wall',
303+
'-Werror',
303304
'-W',
304305
'-Wno-unused-parameter',
305306
'-Wnon-virtual-dtor']

deps/v8/include/v8-profiler.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ class V8EXPORT HeapGraphNode {
258258
*/
259259
Handle<String> GetName() const;
260260

261+
/**
262+
* Returns node id. For the same heap object, the id remains the same
263+
* across all snapshots.
264+
*/
265+
uint64_t GetId() const;
266+
261267
/** Returns node's own size, in bytes. */
262268
int GetSelfSize() const;
263269

@@ -290,6 +296,16 @@ class V8EXPORT HeapGraphNode {
290296
};
291297

292298

299+
class V8EXPORT HeapSnapshotsDiff {
300+
public:
301+
/** Returns the root node for added nodes. */
302+
const HeapGraphNode* GetAdditionsRoot() const;
303+
304+
/** Returns the root node for deleted nodes. */
305+
const HeapGraphNode* GetDeletionsRoot() const;
306+
};
307+
308+
293309
/**
294310
* HeapSnapshots record the state of the JS heap at some moment.
295311
*/
@@ -302,7 +318,10 @@ class V8EXPORT HeapSnapshot {
302318
Handle<String> GetTitle() const;
303319

304320
/** Returns the root node of the heap graph. */
305-
const HeapGraphNode* GetHead() const;
321+
const HeapGraphNode* GetRoot() const;
322+
323+
/** Returns a diff between this snapshot and another one. */
324+
const HeapSnapshotsDiff* CompareWith(const HeapSnapshot* snapshot) const;
306325
};
307326

308327

deps/v8/include/v8.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ class Top;
137137
/**
138138
* A weak reference callback function.
139139
*
140+
* This callback should either explicitly invoke Dispose on |object| if
141+
* V8 wrapper is not needed anymore, or 'revive' it by invocation of MakeWeak.
142+
*
140143
* \param object the weak global object to be reclaimed by the garbage collector
141144
* \param parameter the value passed in when making the weak global object
142145
*/
@@ -146,9 +149,9 @@ typedef void (*WeakReferenceCallback)(Persistent<Value> object,
146149

147150
// --- H a n d l e s ---
148151

149-
#define TYPE_CHECK(T, S) \
150-
while (false) { \
151-
*(static_cast<T**>(0)) = static_cast<S*>(0); \
152+
#define TYPE_CHECK(T, S) \
153+
while (false) { \
154+
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
152155
}
153156

154157
/**

deps/v8/src/api.cc

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4561,6 +4561,12 @@ Handle<String> HeapGraphNode::GetName() const {
45614561
}
45624562

45634563

4564+
uint64_t HeapGraphNode::GetId() const {
4565+
IsDeadCheck("v8::HeapGraphNode::GetId");
4566+
return reinterpret_cast<const i::HeapEntry*>(this)->id();
4567+
}
4568+
4569+
45644570
int HeapGraphNode::GetSelfSize() const {
45654571
IsDeadCheck("v8::HeapGraphNode::GetSelfSize");
45664572
return reinterpret_cast<const i::HeapEntry*>(this)->self_size();
@@ -4624,6 +4630,22 @@ const HeapGraphPath* HeapGraphNode::GetRetainingPath(int index) const {
46244630
}
46254631

46264632

4633+
const HeapGraphNode* HeapSnapshotsDiff::GetAdditionsRoot() const {
4634+
IsDeadCheck("v8::HeapSnapshotsDiff::GetAdditionsRoot");
4635+
const i::HeapSnapshotsDiff* diff =
4636+
reinterpret_cast<const i::HeapSnapshotsDiff*>(this);
4637+
return reinterpret_cast<const HeapGraphNode*>(diff->additions_root());
4638+
}
4639+
4640+
4641+
const HeapGraphNode* HeapSnapshotsDiff::GetDeletionsRoot() const {
4642+
IsDeadCheck("v8::HeapSnapshotsDiff::GetDeletionsRoot");
4643+
const i::HeapSnapshotsDiff* diff =
4644+
reinterpret_cast<const i::HeapSnapshotsDiff*>(this);
4645+
return reinterpret_cast<const HeapGraphNode*>(diff->deletions_root());
4646+
}
4647+
4648+
46274649
unsigned HeapSnapshot::GetUid() const {
46284650
IsDeadCheck("v8::HeapSnapshot::GetUid");
46294651
return reinterpret_cast<const i::HeapSnapshot*>(this)->uid();
@@ -4639,14 +4661,26 @@ Handle<String> HeapSnapshot::GetTitle() const {
46394661
}
46404662

46414663

4642-
const HeapGraphNode* HeapSnapshot::GetHead() const {
4664+
const HeapGraphNode* HeapSnapshot::GetRoot() const {
46434665
IsDeadCheck("v8::HeapSnapshot::GetHead");
46444666
const i::HeapSnapshot* snapshot =
46454667
reinterpret_cast<const i::HeapSnapshot*>(this);
46464668
return reinterpret_cast<const HeapGraphNode*>(snapshot->const_root());
46474669
}
46484670

46494671

4672+
const HeapSnapshotsDiff* HeapSnapshot::CompareWith(
4673+
const HeapSnapshot* snapshot) const {
4674+
IsDeadCheck("v8::HeapSnapshot::CompareWith");
4675+
i::HeapSnapshot* snapshot1 = const_cast<i::HeapSnapshot*>(
4676+
reinterpret_cast<const i::HeapSnapshot*>(this));
4677+
i::HeapSnapshot* snapshot2 = const_cast<i::HeapSnapshot*>(
4678+
reinterpret_cast<const i::HeapSnapshot*>(snapshot));
4679+
return reinterpret_cast<const HeapSnapshotsDiff*>(
4680+
snapshot1->CompareWith(snapshot2));
4681+
}
4682+
4683+
46504684
int HeapProfiler::GetSnapshotsCount() {
46514685
IsDeadCheck("v8::HeapProfiler::GetSnapshotsCount");
46524686
return i::HeapProfiler::GetSnapshotsCount();

deps/v8/src/arm/assembler-arm.cc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,30 @@ void Assembler::clz(Register dst, Register src, Condition cond) {
11921192
}
11931193

11941194

1195+
// Saturating instructions.
1196+
1197+
// Unsigned saturate.
1198+
void Assembler::usat(Register dst,
1199+
int satpos,
1200+
const Operand& src,
1201+
Condition cond) {
1202+
// v6 and above.
1203+
ASSERT(CpuFeatures::IsSupported(ARMv7));
1204+
ASSERT(!dst.is(pc) && !src.rm_.is(pc));
1205+
ASSERT((satpos >= 0) && (satpos <= 31));
1206+
ASSERT((src.shift_op_ == ASR) || (src.shift_op_ == LSL));
1207+
ASSERT(src.rs_.is(no_reg));
1208+
1209+
int sh = 0;
1210+
if (src.shift_op_ == ASR) {
1211+
sh = 1;
1212+
}
1213+
1214+
emit(cond | 0x6*B24 | 0xe*B20 | satpos*B16 | dst.code()*B12 |
1215+
src.shift_imm_*B7 | sh*B6 | 0x1*B4 | src.rm_.code());
1216+
}
1217+
1218+
11951219
// Bitfield manipulation instructions.
11961220

11971221
// Unsigned bit field extract.

deps/v8/src/arm/assembler-arm.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ class Operand BASE_EMBEDDED {
445445
}
446446

447447
Register rm() const { return rm_; }
448+
Register rs() const { return rs_; }
449+
ShiftOp shift_op() const { return shift_op_; }
448450

449451
private:
450452
Register rm_;
@@ -834,6 +836,25 @@ class Assembler : public Malloced {
834836

835837
void clz(Register dst, Register src, Condition cond = al); // v5 and above
836838

839+
// Saturating instructions. v6 and above.
840+
841+
// Unsigned saturate.
842+
//
843+
// Saturate an optionally shifted signed value to an unsigned range.
844+
//
845+
// usat dst, #satpos, src
846+
// usat dst, #satpos, src, lsl #sh
847+
// usat dst, #satpos, src, asr #sh
848+
//
849+
// Register dst will contain:
850+
//
851+
// 0, if s < 0
852+
// (1 << satpos) - 1, if s > ((1 << satpos) - 1)
853+
// s, otherwise
854+
//
855+
// where s is the contents of src after shifting (if used.)
856+
void usat(Register dst, int satpos, const Operand& src, Condition cond = al);
857+
837858
// Bitfield manipulation instructions. v7 and above.
838859

839860
void ubfx(Register dst, Register src, int lsb, int width,

deps/v8/src/arm/codegen-arm.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4760,6 +4760,24 @@ void CodeGenerator::GenerateIsObject(ZoneList<Expression*>* args) {
47604760
}
47614761

47624762

4763+
void CodeGenerator::GenerateIsSpecObject(ZoneList<Expression*>* args) {
4764+
// This generates a fast version of:
4765+
// (typeof(arg) === 'object' || %_ClassOf(arg) == 'RegExp' ||
4766+
// typeof(arg) == function).
4767+
// It includes undetectable objects (as opposed to IsObject).
4768+
ASSERT(args->length() == 1);
4769+
Load(args->at(0));
4770+
Register value = frame_->PopToRegister();
4771+
__ tst(value, Operand(kSmiTagMask));
4772+
false_target()->Branch(eq);
4773+
// Check that this is an object.
4774+
__ ldr(value, FieldMemOperand(value, HeapObject::kMapOffset));
4775+
__ ldrb(value, FieldMemOperand(value, Map::kInstanceTypeOffset));
4776+
__ cmp(value, Operand(FIRST_JS_OBJECT_TYPE));
4777+
cc_reg_ = ge;
4778+
}
4779+
4780+
47634781
void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) {
47644782
// This generates a fast version of:
47654783
// (%_ClassOf(arg) === 'Function')

deps/v8/src/arm/codegen-arm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ class CodeGenerator: public AstVisitor {
475475
void GenerateIsArray(ZoneList<Expression*>* args);
476476
void GenerateIsRegExp(ZoneList<Expression*>* args);
477477
void GenerateIsObject(ZoneList<Expression*>* args);
478+
void GenerateIsSpecObject(ZoneList<Expression*>* args);
478479
void GenerateIsFunction(ZoneList<Expression*>* args);
479480
void GenerateIsUndetectableObject(ZoneList<Expression*>* args);
480481

deps/v8/src/arm/disasm-arm.cc

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class Decoder {
106106
void PrintCondition(Instr* instr);
107107
void PrintShiftRm(Instr* instr);
108108
void PrintShiftImm(Instr* instr);
109+
void PrintShiftSat(Instr* instr);
109110
void PrintPU(Instr* instr);
110111
void PrintSoftwareInterrupt(SoftwareInterruptCodes swi);
111112

@@ -248,6 +249,18 @@ void Decoder::PrintShiftImm(Instr* instr) {
248249
}
249250

250251

252+
// Print the optional shift and immediate used by saturating instructions.
253+
void Decoder::PrintShiftSat(Instr* instr) {
254+
int shift = instr->Bits(11, 7);
255+
if (shift > 0) {
256+
out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_,
257+
", %s #%d",
258+
shift_names[instr->Bit(6) * 2],
259+
instr->Bits(11, 7));
260+
}
261+
}
262+
263+
251264
// Print PU formatting to reduce complexity of FormatOption.
252265
void Decoder::PrintPU(Instr* instr) {
253266
switch (instr->PUField()) {
@@ -440,6 +453,20 @@ int Decoder::FormatOption(Instr* instr, const char* format) {
440453
}
441454
return 1;
442455
}
456+
case 'i': { // 'i: immediate value from adjacent bits.
457+
// Expects tokens in the form imm%02d@%02d, ie. imm05@07, imm10@16
458+
int width = (format[3] - '0') * 10 + (format[4] - '0');
459+
int lsb = (format[6] - '0') * 10 + (format[7] - '0');
460+
461+
ASSERT((width >= 1) && (width <= 32));
462+
ASSERT((lsb >= 0) && (lsb <= 31));
463+
ASSERT((width + lsb) <= 32);
464+
465+
out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_,
466+
"#%d",
467+
instr->Bits(width + lsb - 1, lsb));
468+
return 8;
469+
}
443470
case 'l': { // 'l: branch and link
444471
if (instr->HasLink()) {
445472
Print("l");
@@ -507,7 +534,7 @@ int Decoder::FormatOption(Instr* instr, const char* format) {
507534
return FormatRegister(instr, format);
508535
}
509536
case 's': {
510-
if (format[1] == 'h') { // 'shift_op or 'shift_rm
537+
if (format[1] == 'h') { // 'shift_op or 'shift_rm or 'shift_sat.
511538
if (format[6] == 'o') { // 'shift_op
512539
ASSERT(STRING_STARTS_WITH(format, "shift_op"));
513540
if (instr->TypeField() == 0) {
@@ -517,6 +544,10 @@ int Decoder::FormatOption(Instr* instr, const char* format) {
517544
PrintShiftImm(instr);
518545
}
519546
return 8;
547+
} else if (format[6] == 's') { // 'shift_sat.
548+
ASSERT(STRING_STARTS_WITH(format, "shift_sat"));
549+
PrintShiftSat(instr);
550+
return 9;
520551
} else { // 'shift_rm
521552
ASSERT(STRING_STARTS_WITH(format, "shift_rm"));
522553
PrintShiftRm(instr);
@@ -897,8 +928,16 @@ void Decoder::DecodeType3(Instr* instr) {
897928
break;
898929
}
899930
case 1: {
900-
ASSERT(!instr->HasW());
901-
Format(instr, "'memop'cond'b 'rd, ['rn], +'shift_rm");
931+
if (instr->HasW()) {
932+
ASSERT(instr->Bits(5, 4) == 0x1);
933+
if (instr->Bit(22) == 0x1) {
934+
Format(instr, "usat 'rd, 'imm05@16, 'rm'shift_sat");
935+
} else {
936+
UNREACHABLE(); // SSAT.
937+
}
938+
} else {
939+
Format(instr, "'memop'cond'b 'rd, ['rn], +'shift_rm");
940+
}
902941
break;
903942
}
904943
case 2: {

0 commit comments

Comments
 (0)