Skip to content
This repository was archived by the owner on Oct 16, 2021. It is now read-only.

Commit 279361b

Browse files
committed
v8: update to 3.14.5.9
1 parent fda2b31 commit 279361b

13 files changed

+49
-49
lines changed

deps/v8/build/common.gypi

+10-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
[ 'v8_use_arm_eabi_hardfloat=="true"', {
158158
'defines': [
159159
'USE_EABI_HARDFLOAT=1',
160-
'CAN_USE_VFP2_INSTRUCTIONS',
160+
'CAN_USE_VFP3_INSTRUCTIONS',
161161
],
162162
'target_conditions': [
163163
['_toolset=="target"', {
@@ -378,6 +378,15 @@
378378
'conditions': [
379379
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
380380
or OS=="android"', {
381+
'cflags!': [
382+
'-O2',
383+
'-Os',
384+
],
385+
'cflags': [
386+
'-fdata-sections',
387+
'-ffunction-sections',
388+
'-O3',
389+
],
381390
'conditions': [
382391
[ 'gcc_version==44 and clang==0', {
383392
'cflags': [

deps/v8/src/flag-definitions.h

+2
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ DEFINE_int(sim_stack_alignment, 8,
449449
"Stack alingment in bytes in simulator (4 or 8, 8 is default)")
450450

451451
// isolate.cc
452+
DEFINE_bool(abort_on_uncaught_exception, false,
453+
"abort program (dump core) when an uncaught exception is thrown")
452454
DEFINE_bool(trace_exception, false,
453455
"print stack trace when throwing exceptions")
454456
DEFINE_bool(preallocate_message_memory, false,

deps/v8/src/isolate.cc

+15
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ bool Isolate::IsErrorObject(Handle<Object> obj) {
10801080
return false;
10811081
}
10821082

1083+
static int fatal_exception_depth = 0;
10831084

10841085
void Isolate::DoThrow(Object* exception, MessageLocation* location) {
10851086
ASSERT(!has_pending_exception());
@@ -1150,6 +1151,20 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
11501151
thread_local_top()->pending_message_start_pos_ = location->start_pos();
11511152
thread_local_top()->pending_message_end_pos_ = location->end_pos();
11521153
}
1154+
1155+
// If the abort-on-uncaught-exception flag is specified, abort on any
1156+
// exception not caught by JavaScript, even when an external handler is
1157+
// present. This flag is intended for use by JavaScript developers, so
1158+
// print a user-friendly stack trace (not an internal one).
1159+
if (fatal_exception_depth == 0 &&
1160+
FLAG_abort_on_uncaught_exception &&
1161+
(report_exception || can_be_caught_externally)) {
1162+
fatal_exception_depth++;
1163+
fprintf(stderr, "%s\n\nFROM\n",
1164+
*MessageHandler::GetLocalizedMessage(this, message_obj));
1165+
PrintCurrentStackTrace(stderr);
1166+
OS::Abort();
1167+
}
11531168
} else if (location != NULL && !location->script().is_null()) {
11541169
// We are bootstrapping and caught an error where the location is set
11551170
// and we have a script for the location.

deps/v8/src/json-parser.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonValue() {
287287
// Parse a JSON object. Position must be right at '{'.
288288
template <bool seq_ascii>
289289
Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
290-
HandleScope scope;
291290
Handle<Object> prototype;
292291
Handle<JSObject> json_object =
293292
factory()->NewJSObject(object_constructor());
@@ -361,13 +360,12 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
361360
if (!prototype.is_null()) SetPrototype(json_object, prototype);
362361
}
363362
AdvanceSkipWhitespace();
364-
return scope.CloseAndEscape(json_object);
363+
return json_object;
365364
}
366365

367366
// Parse a JSON array. Position must be right at '['.
368367
template <bool seq_ascii>
369368
Handle<Object> JsonParser<seq_ascii>::ParseJsonArray() {
370-
HandleScope scope;
371369
ZoneScope zone_scope(zone(), DELETE_ON_EXIT);
372370
ZoneList<Handle<Object> > elements(4, zone());
373371
ASSERT_EQ(c0_, '[');
@@ -390,8 +388,7 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonArray() {
390388
for (int i = 0, n = elements.length(); i < n; i++) {
391389
fast_elements->set(i, *elements[i]);
392390
}
393-
Handle<Object> json_array = factory()->NewJSArrayWithElements(fast_elements);
394-
return scope.CloseAndEscape(json_array);
391+
return factory()->NewJSArrayWithElements(fast_elements);
395392
}
396393

397394

deps/v8/src/objects-inl.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -3500,9 +3500,8 @@ Code::Flags Code::ComputeFlags(Kind kind,
35003500
kind == CALL_IC ||
35013501
kind == STORE_IC ||
35023502
kind == KEYED_STORE_IC);
3503-
ASSERT(argc <= Code::kMaxArguments);
35043503
// Compute the bit mask.
3505-
unsigned int bits = KindField::encode(kind)
3504+
int bits = KindField::encode(kind)
35063505
| ICStateField::encode(ic_state)
35073506
| TypeField::encode(type)
35083507
| ExtraICStateField::encode(extra_ic_state)

deps/v8/src/objects.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -4180,8 +4180,8 @@ class Code: public HeapObject {
41804180
// FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that
41814181
// enumeration type has correct value range (see Issue 830 for more details).
41824182
enum Flags {
4183-
FLAGS_MIN_VALUE = 0,
4184-
FLAGS_MAX_VALUE = kMaxUInt32
4183+
FLAGS_MIN_VALUE = kMinInt,
4184+
FLAGS_MAX_VALUE = kMaxInt
41854185
};
41864186

41874187
#define CODE_KIND_LIST(V) \
@@ -4644,9 +4644,6 @@ class Code: public HeapObject {
46444644
// Signed field cannot be encoded using the BitField class.
46454645
static const int kArgumentsCountShift = 14;
46464646
static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1);
4647-
static const int kArgumentsBits =
4648-
PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1;
4649-
static const int kMaxArguments = (1 << kArgumentsBits) - 1;
46504647

46514648
// This constant should be encodable in an ARM instruction.
46524649
static const int kFlagsNotUsedInLookup =

deps/v8/src/parser.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -4243,7 +4243,7 @@ ZoneList<Expression*>* Parser::ParseArguments(bool* ok) {
42434243
while (!done) {
42444244
Expression* argument = ParseAssignmentExpression(true, CHECK_OK);
42454245
result->Add(argument, zone());
4246-
if (result->length() > Code::kMaxArguments) {
4246+
if (result->length() > kMaxNumFunctionParameters) {
42474247
ReportMessageAt(scanner().location(), "too_many_arguments",
42484248
Vector<const char*>::empty());
42494249
*ok = false;
@@ -4420,7 +4420,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> function_name,
44204420

44214421
top_scope_->DeclareParameter(param_name, VAR);
44224422
num_parameters++;
4423-
if (num_parameters > Code::kMaxArguments) {
4423+
if (num_parameters > kMaxNumFunctionParameters) {
44244424
ReportMessageAt(scanner().location(), "too_many_parameters",
44254425
Vector<const char*>::empty());
44264426
*ok = false;

deps/v8/src/parser.h

+5
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,11 @@ class Parser {
449449
Vector<Handle<String> > args);
450450

451451
private:
452+
// Limit on number of function parameters is chosen arbitrarily.
453+
// Code::Flags uses only the low 17 bits of num-parameters to
454+
// construct a hashable id, so if more than 2^17 are allowed, this
455+
// should be checked.
456+
static const int kMaxNumFunctionParameters = 32766;
452457
static const int kMaxNumFunctionLocals = 131071; // 2^17-1
453458

454459
enum Mode {

deps/v8/src/platform-posix.cc

+1-16
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,11 @@ void* OS::GetRandomMmapAddr() {
109109
raw_addr &= V8_UINT64_C(0x3ffffffff000);
110110
#else
111111
uint32_t raw_addr = V8::RandomPrivate(isolate);
112-
113-
raw_addr &= 0x3ffff000;
114-
115-
# ifdef __sun
116-
// For our Solaris/illumos mmap hint, we pick a random address in the bottom
117-
// half of the top half of the address space (that is, the third quarter).
118-
// Because we do not MAP_FIXED, this will be treated only as a hint -- the
119-
// system will not fail to mmap() because something else happens to already
120-
// be mapped at our random address. We deliberately set the hint high enough
121-
// to get well above the system's break (that is, the heap); Solaris and
122-
// illumos will try the hint and if that fails allocate as if there were
123-
// no hint at all. The high hint prevents the break from getting hemmed in
124-
// at low values, ceding half of the address space to the system heap.
125-
raw_addr += 0x80000000;
126-
# else
127112
// The range 0x20000000 - 0x60000000 is relatively unpopulated across a
128113
// variety of ASLR modes (PAE kernel, NX compat mode, etc) and on macos
129114
// 10.6 and 10.7.
115+
raw_addr &= 0x3ffff000;
130116
raw_addr += 0x20000000;
131-
# endif
132117
#endif
133118
return reinterpret_cast<void*>(raw_addr);
134119
}

deps/v8/src/stub-cache.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ Handle<Code> StubCache::ComputeCallConstant(int argc,
617617
Handle<Code> code =
618618
compiler.CompileCallConstant(object, holder, function, name, check);
619619
code->set_check_type(check);
620-
ASSERT(flags == code->flags());
620+
ASSERT_EQ(flags, code->flags());
621621
PROFILE(isolate_,
622622
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
623623
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
@@ -655,7 +655,7 @@ Handle<Code> StubCache::ComputeCallField(int argc,
655655
Handle<Code> code =
656656
compiler.CompileCallField(Handle<JSObject>::cast(object),
657657
holder, index, name);
658-
ASSERT(flags == code->flags());
658+
ASSERT_EQ(flags, code->flags());
659659
PROFILE(isolate_,
660660
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
661661
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
@@ -692,7 +692,7 @@ Handle<Code> StubCache::ComputeCallInterceptor(int argc,
692692
Handle<Code> code =
693693
compiler.CompileCallInterceptor(Handle<JSObject>::cast(object),
694694
holder, name);
695-
ASSERT(flags == code->flags());
695+
ASSERT_EQ(flags, code->flags());
696696
PROFILE(isolate(),
697697
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
698698
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
@@ -721,7 +721,7 @@ Handle<Code> StubCache::ComputeCallGlobal(int argc,
721721
CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder);
722722
Handle<Code> code =
723723
compiler.CompileCallGlobal(receiver, holder, cell, function, name);
724-
ASSERT(flags == code->flags());
724+
ASSERT_EQ(flags, code->flags());
725725
PROFILE(isolate(),
726726
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
727727
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));

deps/v8/src/v8utils.h

-2
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define MAJOR_VERSION 3
3636
#define MINOR_VERSION 14
3737
#define BUILD_NUMBER 5
38-
#define PATCH_LEVEL 8
38+
#define PATCH_LEVEL 9
3939
// Use 1 for candidates and 0 otherwise.
4040
// (Boolean macro values are not supported by all preprocessors.)
4141
#define IS_CANDIDATE_VERSION 0

deps/v8/tools/gen-postmortem-metadata.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,16 @@
7676
{ 'name': 'SmiTag', 'value': 'kSmiTag' },
7777
{ 'name': 'SmiTagMask', 'value': 'kSmiTagMask' },
7878
{ 'name': 'SmiValueShift', 'value': 'kSmiTagSize' },
79-
{ 'name': 'SmiShiftSize', 'value': 'kSmiShiftSize' },
8079
{ 'name': 'PointerSizeLog2', 'value': 'kPointerSizeLog2' },
8180

82-
{ 'name': 'prop_desc_key',
83-
'value': 'DescriptorArray::kDescriptorKey' },
84-
{ 'name': 'prop_desc_details',
85-
'value': 'DescriptorArray::kDescriptorDetails' },
86-
{ 'name': 'prop_desc_value',
87-
'value': 'DescriptorArray::kDescriptorValue' },
88-
{ 'name': 'prop_desc_size',
89-
'value': 'DescriptorArray::kDescriptorSize' },
81+
{ 'name': 'prop_idx_transitions',
82+
'value': 'DescriptorArray::kTransitionsIndex' },
9083
{ 'name': 'prop_idx_first',
9184
'value': 'DescriptorArray::kFirstIndex' },
9285
{ 'name': 'prop_type_field',
9386
'value': 'FIELD' },
9487
{ 'name': 'prop_type_first_phantom',
95-
'value': 'Code::MAP_TRANSITION' },
88+
'value': 'MAP_TRANSITION' },
9689
{ 'name': 'prop_type_mask',
9790
'value': 'PropertyDetails::TypeField::kMask' },
9891

@@ -114,7 +107,7 @@
114107
'JSObject, elements, Object, kElementsOffset',
115108
'FixedArray, data, uintptr_t, kHeaderSize',
116109
'Map, instance_attributes, int, kInstanceAttributesOffset',
117-
'Map, transitions, uintptr_t, kTransitionsOrBackPointerOffset',
110+
'Map, instance_descriptors, int, kInstanceDescriptorsOrBitField3Offset',
118111
'Map, inobject_properties, int, kInObjectPropertiesOffset',
119112
'Map, instance_size, int, kInstanceSizeOffset',
120113
'HeapNumber, value, double, kValueOffset',

0 commit comments

Comments
 (0)