Skip to content

Commit 028908a

Browse files
committed
Upgrade V8 to 3.5.8
1 parent 8af0abd commit 028908a

Some content is hidden

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

44 files changed

+731
-402
lines changed

deps/v8/ChangeLog

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2011-08-24: Version 3.5.8
2+
3+
Added V8EXPORT attributes for v8::Array::CheckCast and
4+
v8::Number::CheckCast.
5+
6+
Made a slight API change enabling opting out from null termination
7+
in String::Write*().
8+
9+
Fixed arm build for gcc-4.6.
10+
11+
112
2011-08-22: Version 3.5.7
213

314
Make scanner handle invalid unicode escapes in identifiers correctly.

deps/v8/include/v8-debug.h

100755100644
File mode changed.

deps/v8/include/v8.h

+11-10
Original file line numberDiff line numberDiff line change
@@ -1039,29 +1039,30 @@ class String : public Primitive {
10391039
* \param length The number of characters to copy from the string. For
10401040
* WriteUtf8 the number of bytes in the buffer.
10411041
* \param nchars_ref The number of characters written, can be NULL.
1042-
* \param hints Various hints that might affect performance of this or
1042+
* \param options Various options that might affect performance of this or
10431043
* subsequent operations.
10441044
* \return The number of characters copied to the buffer excluding the null
10451045
* terminator. For WriteUtf8: The number of bytes copied to the buffer
1046-
* including the null terminator.
1046+
* including the null terminator (if written).
10471047
*/
1048-
enum WriteHints {
1049-
NO_HINTS = 0,
1050-
HINT_MANY_WRITES_EXPECTED = 1
1048+
enum WriteOptions {
1049+
NO_OPTIONS = 0,
1050+
HINT_MANY_WRITES_EXPECTED = 1,
1051+
NO_NULL_TERMINATION = 2
10511052
};
10521053

10531054
V8EXPORT int Write(uint16_t* buffer,
10541055
int start = 0,
10551056
int length = -1,
1056-
WriteHints hints = NO_HINTS) const; // UTF-16
1057+
int options = NO_OPTIONS) const; // UTF-16
10571058
V8EXPORT int WriteAscii(char* buffer,
10581059
int start = 0,
10591060
int length = -1,
1060-
WriteHints hints = NO_HINTS) const; // ASCII
1061+
int options = NO_OPTIONS) const; // ASCII
10611062
V8EXPORT int WriteUtf8(char* buffer,
10621063
int length = -1,
10631064
int* nchars_ref = NULL,
1064-
WriteHints hints = NO_HINTS) const; // UTF-8
1065+
int options = NO_OPTIONS) const; // UTF-8
10651066

10661067
/**
10671068
* A zero length string.
@@ -1335,7 +1336,7 @@ class Number : public Primitive {
13351336
static inline Number* Cast(v8::Value* obj);
13361337
private:
13371338
V8EXPORT Number();
1338-
static void CheckCast(v8::Value* obj);
1339+
V8EXPORT static void CheckCast(v8::Value* obj);
13391340
};
13401341

13411342

@@ -1709,7 +1710,7 @@ class Array : public Object {
17091710
static inline Array* Cast(Value* obj);
17101711
private:
17111712
V8EXPORT Array();
1712-
static void CheckCast(Value* obj);
1713+
V8EXPORT static void CheckCast(Value* obj);
17131714
};
17141715

17151716

deps/v8/src/SConscript

100755100644
File mode changed.

deps/v8/src/api.cc

+12-10
Original file line numberDiff line numberDiff line change
@@ -3621,15 +3621,15 @@ int String::Utf8Length() const {
36213621
int String::WriteUtf8(char* buffer,
36223622
int capacity,
36233623
int* nchars_ref,
3624-
WriteHints hints) const {
3624+
int options) const {
36253625
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
36263626
if (IsDeadCheck(isolate, "v8::String::WriteUtf8()")) return 0;
36273627
LOG_API(isolate, "String::WriteUtf8");
36283628
ENTER_V8(isolate);
36293629
i::StringInputBuffer& write_input_buffer = *isolate->write_input_buffer();
36303630
i::Handle<i::String> str = Utils::OpenHandle(this);
36313631
isolate->string_tracker()->RecordWrite(str);
3632-
if (hints & HINT_MANY_WRITES_EXPECTED) {
3632+
if (options & HINT_MANY_WRITES_EXPECTED) {
36333633
// Flatten the string for efficiency. This applies whether we are
36343634
// using StringInputBuffer or Get(i) to access the characters.
36353635
str->TryFlatten();
@@ -3669,7 +3669,8 @@ int String::WriteUtf8(char* buffer,
36693669
}
36703670
}
36713671
if (nchars_ref != NULL) *nchars_ref = nchars;
3672-
if (i == len && (capacity == -1 || pos < capacity))
3672+
if (!(options & NO_NULL_TERMINATION) &&
3673+
(i == len && (capacity == -1 || pos < capacity)))
36733674
buffer[pos++] = '\0';
36743675
return pos;
36753676
}
@@ -3678,7 +3679,7 @@ int String::WriteUtf8(char* buffer,
36783679
int String::WriteAscii(char* buffer,
36793680
int start,
36803681
int length,
3681-
WriteHints hints) const {
3682+
int options) const {
36823683
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
36833684
if (IsDeadCheck(isolate, "v8::String::WriteAscii()")) return 0;
36843685
LOG_API(isolate, "String::WriteAscii");
@@ -3687,7 +3688,7 @@ int String::WriteAscii(char* buffer,
36873688
ASSERT(start >= 0 && length >= -1);
36883689
i::Handle<i::String> str = Utils::OpenHandle(this);
36893690
isolate->string_tracker()->RecordWrite(str);
3690-
if (hints & HINT_MANY_WRITES_EXPECTED) {
3691+
if (options & HINT_MANY_WRITES_EXPECTED) {
36913692
// Flatten the string for efficiency. This applies whether we are
36923693
// using StringInputBuffer or Get(i) to access the characters.
36933694
str->TryFlatten();
@@ -3703,7 +3704,7 @@ int String::WriteAscii(char* buffer,
37033704
if (c == '\0') c = ' ';
37043705
buffer[i] = c;
37053706
}
3706-
if (length == -1 || i < length)
3707+
if (!(options & NO_NULL_TERMINATION) && (length == -1 || i < length))
37073708
buffer[i] = '\0';
37083709
return i;
37093710
}
@@ -3712,15 +3713,15 @@ int String::WriteAscii(char* buffer,
37123713
int String::Write(uint16_t* buffer,
37133714
int start,
37143715
int length,
3715-
WriteHints hints) const {
3716+
int options) const {
37163717
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
37173718
if (IsDeadCheck(isolate, "v8::String::Write()")) return 0;
37183719
LOG_API(isolate, "String::Write");
37193720
ENTER_V8(isolate);
37203721
ASSERT(start >= 0 && length >= -1);
37213722
i::Handle<i::String> str = Utils::OpenHandle(this);
37223723
isolate->string_tracker()->RecordWrite(str);
3723-
if (hints & HINT_MANY_WRITES_EXPECTED) {
3724+
if (options & HINT_MANY_WRITES_EXPECTED) {
37243725
// Flatten the string for efficiency. This applies whether we are
37253726
// using StringInputBuffer or Get(i) to access the characters.
37263727
str->TryFlatten();
@@ -3730,7 +3731,8 @@ int String::Write(uint16_t* buffer,
37303731
end = str->length();
37313732
if (end < 0) return 0;
37323733
i::String::WriteToFlat(*str, buffer, start, end);
3733-
if (length == -1 || end - start < length) {
3734+
if (!(options & NO_NULL_TERMINATION) &&
3735+
(length == -1 || end - start < length)) {
37343736
buffer[end - start] = '\0';
37353737
}
37363738
return end - start;
@@ -4118,7 +4120,7 @@ bool Context::InContext() {
41184120

41194121
v8::Local<v8::Context> Context::GetEntered() {
41204122
i::Isolate* isolate = i::Isolate::Current();
4121-
if (IsDeadCheck(isolate, "v8::Context::GetEntered()")) {
4123+
if (!EnsureInitializedForIsolate(isolate, "v8::Context::GetEntered()")) {
41224124
return Local<Context>();
41234125
}
41244126
i::Handle<i::Object> last =

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

+3
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ class Operand BASE_EMBEDDED {
377377
// immediate
378378
INLINE(explicit Operand(int32_t immediate,
379379
RelocInfo::Mode rmode = RelocInfo::NONE));
380+
INLINE(static Operand Zero()) {
381+
return Operand(static_cast<int32_t>(0));
382+
}
380383
INLINE(explicit Operand(const ExternalReference& f));
381384
explicit Operand(Handle<Object> handle);
382385
INLINE(explicit Operand(Smi* value));

deps/v8/src/arm/code-stubs-arm.cc

+15-17
Original file line numberDiff line numberDiff line change
@@ -549,15 +549,15 @@ void FloatingPointHelper::ConvertIntToDouble(MacroAssembler* masm,
549549
// | s | exp | mantissa |
550550

551551
// Check for zero.
552-
__ cmp(int_scratch, Operand(0));
552+
__ cmp(int_scratch, Operand::Zero());
553553
__ mov(dst2, int_scratch);
554554
__ mov(dst1, int_scratch);
555555
__ b(eq, &done);
556556

557557
// Preload the sign of the value.
558558
__ and_(dst2, int_scratch, Operand(HeapNumber::kSignMask), SetCC);
559559
// Get the absolute value of the object (as an unsigned integer).
560-
__ rsb(int_scratch, int_scratch, Operand(0), SetCC, mi);
560+
__ rsb(int_scratch, int_scratch, Operand::Zero(), SetCC, mi);
561561

562562
// Get mantisssa[51:20].
563563

@@ -589,7 +589,7 @@ void FloatingPointHelper::ConvertIntToDouble(MacroAssembler* masm,
589589
__ mov(scratch2, Operand(int_scratch, LSL, scratch2));
590590
__ orr(dst2, dst2, scratch2);
591591
// Set dst1 to 0.
592-
__ mov(dst1, Operand(0));
592+
__ mov(dst1, Operand::Zero());
593593
}
594594
__ bind(&done);
595595
}
@@ -657,7 +657,7 @@ void FloatingPointHelper::LoadNumberAsInt32Double(MacroAssembler* masm,
657657
// Check for 0 and -0.
658658
__ bic(scratch1, dst1, Operand(HeapNumber::kSignMask));
659659
__ orr(scratch1, scratch1, Operand(dst2));
660-
__ cmp(scratch1, Operand(0));
660+
__ cmp(scratch1, Operand::Zero());
661661
__ b(eq, &done);
662662

663663
// Check that the value can be exactly represented by a 32-bit integer.
@@ -730,7 +730,7 @@ void FloatingPointHelper::LoadNumberAsInt32(MacroAssembler* masm,
730730
// Check for 0 and -0.
731731
__ bic(dst, scratch1, Operand(HeapNumber::kSignMask));
732732
__ orr(dst, scratch2, Operand(dst));
733-
__ cmp(dst, Operand(0));
733+
__ cmp(dst, Operand::Zero());
734734
__ b(eq, &done);
735735

736736
DoubleIs32BitInteger(masm, scratch1, scratch2, dst, scratch3, not_int32);
@@ -747,7 +747,7 @@ void FloatingPointHelper::LoadNumberAsInt32(MacroAssembler* masm,
747747
// Set the sign.
748748
__ ldr(scratch1, FieldMemOperand(object, HeapNumber::kExponentOffset));
749749
__ tst(scratch1, Operand(HeapNumber::kSignMask));
750-
__ rsb(dst, dst, Operand(0), LeaveCC, mi);
750+
__ rsb(dst, dst, Operand::Zero(), LeaveCC, mi);
751751
}
752752

753753
__ bind(&done);
@@ -2424,7 +2424,6 @@ void BinaryOpStub::GenerateSmiCode(
24242424
Register left = r1;
24252425
Register right = r0;
24262426
Register scratch1 = r7;
2427-
Register scratch2 = r9;
24282427

24292428
// Perform combined smi check on both operands.
24302429
__ orr(scratch1, left, Operand(right));
@@ -2618,7 +2617,7 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
26182617
__ b(mi, &return_heap_number);
26192618
// Check for minus zero. Return heap number for minus zero.
26202619
Label not_zero;
2621-
__ cmp(scratch1, Operand(0));
2620+
__ cmp(scratch1, Operand::Zero());
26222621
__ b(ne, &not_zero);
26232622
__ vmov(scratch2, d5.high());
26242623
__ tst(scratch2, Operand(HeapNumber::kSignMask));
@@ -3110,7 +3109,6 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
31103109

31113110
Label no_update;
31123111
Label skip_cache;
3113-
const Register heap_number_map = r5;
31143112

31153113
// Call C function to calculate the result and update the cache.
31163114
// Register r0 holds precalculated cache entry address; preserve
@@ -3581,7 +3579,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
35813579
ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address, isolate);
35823580
__ mov(r5, Operand(ExternalReference(js_entry_sp)));
35833581
__ ldr(r6, MemOperand(r5));
3584-
__ cmp(r6, Operand(0));
3582+
__ cmp(r6, Operand::Zero());
35853583
__ b(ne, &non_outermost_js);
35863584
__ str(fp, MemOperand(r5));
35873585
__ mov(ip, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
@@ -3656,7 +3654,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
36563654
__ pop(r5);
36573655
__ cmp(r5, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
36583656
__ b(ne, &non_outermost_js_2);
3659-
__ mov(r6, Operand(0));
3657+
__ mov(r6, Operand::Zero());
36603658
__ mov(r5, Operand(ExternalReference(js_entry_sp)));
36613659
__ str(r6, MemOperand(r5));
36623660
__ bind(&non_outermost_js_2);
@@ -3857,7 +3855,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
38573855
__ Push(r0, r1);
38583856
__ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_FUNCTION);
38593857
__ LeaveInternalFrame();
3860-
__ cmp(r0, Operand(0));
3858+
__ cmp(r0, Operand::Zero());
38613859
__ LoadRoot(r0, Heap::kTrueValueRootIndex, eq);
38623860
__ LoadRoot(r0, Heap::kFalseValueRootIndex, ne);
38633861
__ Ret(HasArgsInRegisters() ? 0 : 2);
@@ -3991,7 +3989,7 @@ void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) {
39913989
FixedArray::kHeaderSize + 2 * kPointerSize;
39923990
// If there are no mapped parameters, we do not need the parameter_map.
39933991
__ cmp(r1, Operand(Smi::FromInt(0)));
3994-
__ mov(r9, Operand(0), LeaveCC, eq);
3992+
__ mov(r9, Operand::Zero(), LeaveCC, eq);
39953993
__ mov(r9, Operand(r1, LSL, 1), LeaveCC, ne);
39963994
__ add(r9, r9, Operand(kParameterMapHeaderSize), LeaveCC, ne);
39973995

@@ -4015,7 +4013,7 @@ void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) {
40154013

40164014
__ ldr(r4, MemOperand(r8, Context::SlotOffset(Context::GLOBAL_INDEX)));
40174015
__ ldr(r4, FieldMemOperand(r4, GlobalObject::kGlobalContextOffset));
4018-
__ cmp(r1, Operand(0));
4016+
__ cmp(r1, Operand::Zero());
40194017
__ ldr(r4, MemOperand(r4, kNormalOffset), eq);
40204018
__ ldr(r4, MemOperand(r4, kAliasedOffset), ne);
40214019

@@ -5697,7 +5695,7 @@ void StringCompareStub::GenerateAsciiCharsCompareLoop(
56975695
Operand(SeqAsciiString::kHeaderSize - kHeapObjectTag));
56985696
__ add(left, left, Operand(scratch1));
56995697
__ add(right, right, Operand(scratch1));
5700-
__ rsb(length, length, Operand(0));
5698+
__ rsb(length, length, Operand::Zero());
57015699
Register index = length; // index = -length;
57025700

57035701
// Compare loop.
@@ -6555,7 +6553,7 @@ void StringDictionaryLookupStub::Generate(MacroAssembler* masm) {
65556553
// treated as a lookup success. For positive lookup probing failure
65566554
// should be treated as lookup failure.
65576555
if (mode_ == POSITIVE_LOOKUP) {
6558-
__ mov(result, Operand(0));
6556+
__ mov(result, Operand::Zero());
65596557
__ Ret();
65606558
}
65616559

@@ -6564,7 +6562,7 @@ void StringDictionaryLookupStub::Generate(MacroAssembler* masm) {
65646562
__ Ret();
65656563

65666564
__ bind(&not_in_dictionary);
6567-
__ mov(result, Operand(0));
6565+
__ mov(result, Operand::Zero());
65686566
__ Ret();
65696567
}
65706568

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

-3
Original file line numberDiff line numberDiff line change
@@ -4129,11 +4129,8 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
41294129
default: {
41304130
VisitForAccumulatorValue(expr->right());
41314131
Condition cond = eq;
4132-
bool strict = false;
41334132
switch (op) {
41344133
case Token::EQ_STRICT:
4135-
strict = true;
4136-
// Fall through
41374134
case Token::EQ:
41384135
cond = eq;
41394136
__ pop(r1);

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

-1
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,6 @@ LInstruction* LChunkBuilder::DoPower(HPower* instr) {
13991399

14001400
LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
14011401
Token::Value op = instr->token();
1402-
Representation r = instr->GetInputRepresentation();
14031402
ASSERT(instr->left()->representation().IsTagged());
14041403
ASSERT(instr->right()->representation().IsTagged());
14051404
bool reversed = (op == Token::GT || op == Token::LTE);

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

-3
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,6 @@ Condition LCodeGen::EmitIsObject(Register input,
18041804
void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
18051805
Register reg = ToRegister(instr->InputAt(0));
18061806
Register temp1 = ToRegister(instr->TempAt(0));
1807-
Register temp2 = scratch0();
18081807

18091808
int true_block = chunk_->LookupDestination(instr->true_block_id());
18101809
int false_block = chunk_->LookupDestination(instr->false_block_id());
@@ -2759,7 +2758,6 @@ void LCodeGen::DoOuterContext(LOuterContext* instr) {
27592758

27602759

27612760
void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
2762-
Register context = ToRegister(instr->context());
27632761
Register result = ToRegister(instr->result());
27642762
__ ldr(result, ContextOperand(cp, Context::GLOBAL_INDEX));
27652763
}
@@ -3965,7 +3963,6 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
39653963
Register scratch1 = scratch0();
39663964
Register scratch2 = ToRegister(instr->TempAt(0));
39673965
DwVfpRegister double_input = ToDoubleRegister(instr->InputAt(0));
3968-
DwVfpRegister double_scratch = double_scratch0();
39693966
SwVfpRegister single_scratch = double_scratch0().low();
39703967

39713968
Label done;

deps/v8/src/arm/lithium-gap-resolver-arm.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ void LGapResolver::EmitMove(int index) {
254254
} else {
255255
ASSERT(destination->IsStackSlot());
256256
ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone.
257-
MemOperand destination_operand = cgen_->ToMemOperand(destination);
258257
__ mov(kSavedValueRegister, source_operand);
259258
__ str(kSavedValueRegister, cgen_->ToMemOperand(destination));
260259
}
@@ -265,8 +264,7 @@ void LGapResolver::EmitMove(int index) {
265264
__ vmov(cgen_->ToDoubleRegister(destination), source_register);
266265
} else {
267266
ASSERT(destination->IsDoubleStackSlot());
268-
MemOperand destination_operand = cgen_->ToMemOperand(destination);
269-
__ vstr(source_register, destination_operand);
267+
__ vstr(source_register, cgen_->ToMemOperand(destination));
270268
}
271269

272270
} else if (source->IsDoubleStackSlot()) {

deps/v8/src/arm/stub-cache-arm.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -1183,9 +1183,8 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
11831183
__ JumpIfSmi(receiver, miss);
11841184

11851185
// Check that the maps haven't changed.
1186-
Register reg =
1187-
CheckPrototypes(object, receiver, holder,
1188-
scratch1, scratch2, scratch3, name, miss);
1186+
CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, name,
1187+
miss);
11891188

11901189
// Return the constant value.
11911190
__ mov(r0, Operand(Handle<Object>(value)));

0 commit comments

Comments
 (0)