Skip to content

Commit 8024252

Browse files
committed
V8: Upgrade to 3.15.11.10
1 parent 82f1d34 commit 8024252

14 files changed

+196
-10
lines changed

deps/v8/build/common.gypi

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
[ 'v8_use_arm_eabi_hardfloat=="true"', {
161161
'defines': [
162162
'USE_EABI_HARDFLOAT=1',
163-
'CAN_USE_VFP2_INSTRUCTIONS',
163+
'CAN_USE_VFP3_INSTRUCTIONS',
164164
],
165165
'target_conditions': [
166166
['_toolset=="target"', {
@@ -399,6 +399,15 @@
399399
}],
400400
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
401401
or OS=="android"', {
402+
'cflags!': [
403+
'-O2',
404+
'-Os',
405+
],
406+
'cflags': [
407+
'-fdata-sections',
408+
'-ffunction-sections',
409+
'-O3',
410+
],
402411
'conditions': [
403412
[ 'gcc_version==44 and clang==0', {
404413
'cflags': [

deps/v8/src/hydrogen-instructions.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,13 @@ void HClassOfTestAndBranch::PrintDataTo(StringStream* stream) {
801801
}
802802

803803

804+
void HWrapReceiver::PrintDataTo(StringStream* stream) {
805+
receiver()->PrintNameTo(stream);
806+
stream->Add(" ");
807+
function()->PrintNameTo(stream);
808+
}
809+
810+
804811
void HAccessArgumentsAt::PrintDataTo(StringStream* stream) {
805812
arguments()->PrintNameTo(stream);
806813
stream->Add("[");

deps/v8/src/hydrogen-instructions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,6 +2823,8 @@ class HWrapReceiver: public HTemplateInstruction<2> {
28232823

28242824
virtual HValue* Canonicalize();
28252825

2826+
virtual void PrintDataTo(StringStream* stream);
2827+
28262828
DECLARE_CONCRETE_INSTRUCTION(WrapReceiver)
28272829
};
28282830

deps/v8/src/hydrogen.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7493,7 +7493,10 @@ bool HGraphBuilder::TryCallApply(Call* expr) {
74937493
return true;
74947494
} else {
74957495
// We are inside inlined function and we know exactly what is inside
7496-
// arguments object.
7496+
// arguments object. But we need to be able to materialize at deopt.
7497+
// TODO(mstarzinger): For now we just ensure arguments are pushed
7498+
// right after HEnterInlined, but we could be smarter about this.
7499+
EnsureArgumentsArePushedForAccess();
74977500
HValue* context = environment()->LookupContext();
74987501

74997502
HValue* wrapped_receiver =

deps/v8/src/log-utils.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ void Log::Initialize() {
107107
// one character so we can escape the loop properly.
108108
p--;
109109
break;
110-
case 'p':
111-
stream.Add("%d", OS::GetCurrentProcessId());
112-
break;
113110
case 't': {
114111
// %t expands to the current time in milliseconds.
115112
double time = OS::TimeCurrentMillis();

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

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ void ElementsTransitionGenerator::GenerateSmiToDouble(
246246
HeapObject::kMapOffset,
247247
a3,
248248
t5,
249-
kRAHasBeenSaved,
249+
kRAHasNotBeenSaved,
250250
kDontSaveFPRegs,
251251
OMIT_REMEMBERED_SET,
252252
OMIT_SMI_CHECK);
@@ -517,6 +517,50 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
517517
}
518518

519519

520+
void SeqStringSetCharGenerator::Generate(MacroAssembler* masm,
521+
String::Encoding encoding,
522+
Register string,
523+
Register index,
524+
Register value) {
525+
if (FLAG_debug_code) {
526+
__ And(at, index, Operand(kSmiTagMask));
527+
__ Check(eq, "Non-smi index", at, Operand(zero_reg));
528+
__ And(at, value, Operand(kSmiTagMask));
529+
__ Check(eq, "Non-smi value", at, Operand(zero_reg));
530+
531+
__ lw(at, FieldMemOperand(string, String::kLengthOffset));
532+
__ Check(lt, "Index is too large", at, Operand(index));
533+
534+
__ Check(ge, "Index is negative", index, Operand(Smi::FromInt(0)));
535+
536+
__ lw(at, FieldMemOperand(string, HeapObject::kMapOffset));
537+
__ lbu(at, FieldMemOperand(at, Map::kInstanceTypeOffset));
538+
539+
__ And(at, at, Operand(kStringRepresentationMask | kStringEncodingMask));
540+
static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
541+
static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
542+
__ Check(eq, "Unexpected string type", at,
543+
Operand(encoding == String::ONE_BYTE_ENCODING
544+
? one_byte_seq_type : two_byte_seq_type));
545+
}
546+
547+
__ Addu(at,
548+
string,
549+
Operand(SeqString::kHeaderSize - kHeapObjectTag));
550+
__ SmiUntag(value);
551+
STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
552+
if (encoding == String::ONE_BYTE_ENCODING) {
553+
__ SmiUntag(index);
554+
__ Addu(at, at, index);
555+
__ sb(value, MemOperand(at));
556+
} else {
557+
// No need to untag a smi for two-byte addressing.
558+
__ Addu(at, at, index);
559+
__ sh(value, MemOperand(at));
560+
}
561+
}
562+
563+
520564
static MemOperand ExpConstant(int index, Register base) {
521565
return MemOperand(base, index * kDoubleSize);
522566
}

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3146,6 +3146,38 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
31463146
}
31473147

31483148

3149+
void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3150+
ZoneList<Expression*>* args = expr->arguments();
3151+
ASSERT_EQ(3, args->length());
3152+
3153+
VisitForStackValue(args->at(1)); // index
3154+
VisitForStackValue(args->at(2)); // value
3155+
__ pop(a2);
3156+
__ pop(a1);
3157+
VisitForAccumulatorValue(args->at(0)); // string
3158+
3159+
static const String::Encoding encoding = String::ONE_BYTE_ENCODING;
3160+
SeqStringSetCharGenerator::Generate(masm_, encoding, v0, a1, a2);
3161+
context()->Plug(v0);
3162+
}
3163+
3164+
3165+
void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
3166+
ZoneList<Expression*>* args = expr->arguments();
3167+
ASSERT_EQ(3, args->length());
3168+
3169+
VisitForStackValue(args->at(1)); // index
3170+
VisitForStackValue(args->at(2)); // value
3171+
__ pop(a2);
3172+
__ pop(a1);
3173+
VisitForAccumulatorValue(args->at(0)); // string
3174+
3175+
static const String::Encoding encoding = String::TWO_BYTE_ENCODING;
3176+
SeqStringSetCharGenerator::Generate(masm_, encoding, v0, a1, a2);
3177+
context()->Plug(v0);
3178+
}
3179+
3180+
31493181
void FullCodeGenerator::EmitMathPow(CallRuntime* expr) {
31503182
// Load the arguments on the stack and call the runtime function.
31513183
ZoneList<Expression*>* args = expr->arguments();

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,15 @@ void LCodeGen::DoDateField(LDateField* instr) {
13891389
}
13901390

13911391

1392+
void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
1393+
SeqStringSetCharGenerator::Generate(masm(),
1394+
instr->encoding(),
1395+
ToRegister(instr->string()),
1396+
ToRegister(instr->index()),
1397+
ToRegister(instr->value()));
1398+
}
1399+
1400+
13921401
void LCodeGen::DoBitNotI(LBitNotI* instr) {
13931402
Register input = ToRegister(instr->value());
13941403
Register result = ToRegister(instr->result());

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,16 @@ LInstruction* LChunkBuilder::DoDateField(HDateField* instr) {
15311531
}
15321532

15331533

1534+
LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) {
1535+
LOperand* string = UseRegister(instr->string());
1536+
LOperand* index = UseRegister(instr->index());
1537+
LOperand* value = UseRegister(instr->value());
1538+
LSeqStringSetChar* result =
1539+
new(zone()) LSeqStringSetChar(instr->encoding(), string, index, value);
1540+
return DefineAsRegister(result);
1541+
}
1542+
1543+
15341544
LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
15351545
LOperand* value = UseRegisterOrConstantAtStart(instr->index());
15361546
LOperand* length = UseRegister(instr->length());

deps/v8/src/mips/lithium-mips.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ class LCodeGen;
148148
V(Random) \
149149
V(RegExpLiteral) \
150150
V(Return) \
151+
V(SeqStringSetChar) \
151152
V(ShiftI) \
152153
V(SmiTag) \
153154
V(SmiUntag) \
@@ -1143,6 +1144,30 @@ class LDateField: public LTemplateInstruction<1, 1, 1> {
11431144
};
11441145

11451146

1147+
class LSeqStringSetChar: public LTemplateInstruction<1, 3, 0> {
1148+
public:
1149+
LSeqStringSetChar(String::Encoding encoding,
1150+
LOperand* string,
1151+
LOperand* index,
1152+
LOperand* value) : encoding_(encoding) {
1153+
inputs_[0] = string;
1154+
inputs_[1] = index;
1155+
inputs_[2] = value;
1156+
}
1157+
1158+
String::Encoding encoding() { return encoding_; }
1159+
LOperand* string() { return inputs_[0]; }
1160+
LOperand* index() { return inputs_[1]; }
1161+
LOperand* value() { return inputs_[2]; }
1162+
1163+
DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
1164+
DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
1165+
1166+
private:
1167+
String::Encoding encoding_;
1168+
};
1169+
1170+
11461171
class LThrow: public LTemplateInstruction<0, 1, 0> {
11471172
public:
11481173
explicit LThrow(LOperand* value) {

deps/v8/src/v8utils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ INLINE(void CopyChars(sinkchar* dest, const sourcechar* src, int chars));
209209

210210
template <typename sourcechar, typename sinkchar>
211211
void CopyChars(sinkchar* dest, const sourcechar* src, int chars) {
212-
ASSERT(chars >= 0);
213-
if (chars == 0) return;
214212
sinkchar* limit = dest + chars;
215213
#ifdef V8_HOST_CAN_READ_UNALIGNED
216214
if (sizeof(*dest) == sizeof(*src)) {

deps/v8/src/version.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define MAJOR_VERSION 3
3636
#define MINOR_VERSION 15
3737
#define BUILD_NUMBER 11
38-
#define PATCH_LEVEL 7
38+
#define PATCH_LEVEL 10
3939
// Use 1 for candidates and 0 otherwise.
4040
// (Boolean macro values are not supported by all preprocessors.)
4141
#define IS_CANDIDATE_VERSION 0
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2013 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+
// Flags: --allow-natives-syntax
29+
30+
"use strict";
31+
32+
function f(a, b) {
33+
return g("c", "d");
34+
}
35+
36+
function g(a, b) {
37+
g.constructor.apply(this, arguments);
38+
}
39+
40+
g.constructor = function(a, b) {
41+
assertEquals("c", a);
42+
assertEquals("d", b);
43+
}
44+
45+
f("a", "b");
46+
f("a", "b");
47+
%OptimizeFunctionOnNextCall(f);
48+
f("a", "b");
49+
g.x = "deopt";
50+
f("a", "b");

deps/v8/tools/run-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def ProcessOptions(options):
155155
options.mode = tokens[1]
156156
options.mode = options.mode.split(",")
157157
for mode in options.mode:
158-
if not mode in ["debug", "release"]:
158+
if not mode.lower() in ["debug", "release"]:
159159
print "Unknown mode %s" % mode
160160
return False
161161
if options.arch in ["auto", "native"]:

0 commit comments

Comments
 (0)