From 279361b27729118481ca2e2fecc2c3f930c56f41 Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Thu, 23 May 2013 13:39:12 -0700 Subject: [PATCH] v8: update to 3.14.5.9 --- deps/v8/build/common.gypi | 11 ++++++++++- deps/v8/src/flag-definitions.h | 2 ++ deps/v8/src/isolate.cc | 15 +++++++++++++++ deps/v8/src/json-parser.h | 7 ++----- deps/v8/src/objects-inl.h | 3 +-- deps/v8/src/objects.h | 7 ++----- deps/v8/src/parser.cc | 4 ++-- deps/v8/src/parser.h | 5 +++++ deps/v8/src/platform-posix.cc | 17 +---------------- deps/v8/src/stub-cache.cc | 8 ++++---- deps/v8/src/v8utils.h | 2 -- deps/v8/src/version.cc | 2 +- deps/v8/tools/gen-postmortem-metadata.py | 15 ++++----------- 13 files changed, 49 insertions(+), 49 deletions(-) diff --git a/deps/v8/build/common.gypi b/deps/v8/build/common.gypi index 6e0ef0c..78888b8 100644 --- a/deps/v8/build/common.gypi +++ b/deps/v8/build/common.gypi @@ -157,7 +157,7 @@ [ 'v8_use_arm_eabi_hardfloat=="true"', { 'defines': [ 'USE_EABI_HARDFLOAT=1', - 'CAN_USE_VFP2_INSTRUCTIONS', + 'CAN_USE_VFP3_INSTRUCTIONS', ], 'target_conditions': [ ['_toolset=="target"', { @@ -378,6 +378,15 @@ 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \ or OS=="android"', { + 'cflags!': [ + '-O2', + '-Os', + ], + 'cflags': [ + '-fdata-sections', + '-ffunction-sections', + '-O3', + ], 'conditions': [ [ 'gcc_version==44 and clang==0', { 'cflags': [ diff --git a/deps/v8/src/flag-definitions.h b/deps/v8/src/flag-definitions.h index 4c7c090..0427e7d 100644 --- a/deps/v8/src/flag-definitions.h +++ b/deps/v8/src/flag-definitions.h @@ -449,6 +449,8 @@ DEFINE_int(sim_stack_alignment, 8, "Stack alingment in bytes in simulator (4 or 8, 8 is default)") // isolate.cc +DEFINE_bool(abort_on_uncaught_exception, false, + "abort program (dump core) when an uncaught exception is thrown") DEFINE_bool(trace_exception, false, "print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false, diff --git a/deps/v8/src/isolate.cc b/deps/v8/src/isolate.cc index 75e15a4..04a438b 100644 --- a/deps/v8/src/isolate.cc +++ b/deps/v8/src/isolate.cc @@ -1080,6 +1080,7 @@ bool Isolate::IsErrorObject(Handle obj) { return false; } +static int fatal_exception_depth = 0; void Isolate::DoThrow(Object* exception, MessageLocation* location) { ASSERT(!has_pending_exception()); @@ -1150,6 +1151,20 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) { thread_local_top()->pending_message_start_pos_ = location->start_pos(); thread_local_top()->pending_message_end_pos_ = location->end_pos(); } + + // If the abort-on-uncaught-exception flag is specified, abort on any + // exception not caught by JavaScript, even when an external handler is + // present. This flag is intended for use by JavaScript developers, so + // print a user-friendly stack trace (not an internal one). + if (fatal_exception_depth == 0 && + FLAG_abort_on_uncaught_exception && + (report_exception || can_be_caught_externally)) { + fatal_exception_depth++; + fprintf(stderr, "%s\n\nFROM\n", + *MessageHandler::GetLocalizedMessage(this, message_obj)); + PrintCurrentStackTrace(stderr); + OS::Abort(); + } } else if (location != NULL && !location->script().is_null()) { // We are bootstrapping and caught an error where the location is set // and we have a script for the location. diff --git a/deps/v8/src/json-parser.h b/deps/v8/src/json-parser.h index ebe3db1..03ed22d 100644 --- a/deps/v8/src/json-parser.h +++ b/deps/v8/src/json-parser.h @@ -287,7 +287,6 @@ Handle JsonParser::ParseJsonValue() { // Parse a JSON object. Position must be right at '{'. template Handle JsonParser::ParseJsonObject() { - HandleScope scope; Handle prototype; Handle json_object = factory()->NewJSObject(object_constructor()); @@ -361,13 +360,12 @@ Handle JsonParser::ParseJsonObject() { if (!prototype.is_null()) SetPrototype(json_object, prototype); } AdvanceSkipWhitespace(); - return scope.CloseAndEscape(json_object); + return json_object; } // Parse a JSON array. Position must be right at '['. template Handle JsonParser::ParseJsonArray() { - HandleScope scope; ZoneScope zone_scope(zone(), DELETE_ON_EXIT); ZoneList > elements(4, zone()); ASSERT_EQ(c0_, '['); @@ -390,8 +388,7 @@ Handle JsonParser::ParseJsonArray() { for (int i = 0, n = elements.length(); i < n; i++) { fast_elements->set(i, *elements[i]); } - Handle json_array = factory()->NewJSArrayWithElements(fast_elements); - return scope.CloseAndEscape(json_array); + return factory()->NewJSArrayWithElements(fast_elements); } diff --git a/deps/v8/src/objects-inl.h b/deps/v8/src/objects-inl.h index 4834fa6..ea5a93f 100644 --- a/deps/v8/src/objects-inl.h +++ b/deps/v8/src/objects-inl.h @@ -3500,9 +3500,8 @@ Code::Flags Code::ComputeFlags(Kind kind, kind == CALL_IC || kind == STORE_IC || kind == KEYED_STORE_IC); - ASSERT(argc <= Code::kMaxArguments); // Compute the bit mask. - unsigned int bits = KindField::encode(kind) + int bits = KindField::encode(kind) | ICStateField::encode(ic_state) | TypeField::encode(type) | ExtraICStateField::encode(extra_ic_state) diff --git a/deps/v8/src/objects.h b/deps/v8/src/objects.h index 47d7757..755dd42 100644 --- a/deps/v8/src/objects.h +++ b/deps/v8/src/objects.h @@ -4180,8 +4180,8 @@ class Code: public HeapObject { // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that // enumeration type has correct value range (see Issue 830 for more details). enum Flags { - FLAGS_MIN_VALUE = 0, - FLAGS_MAX_VALUE = kMaxUInt32 + FLAGS_MIN_VALUE = kMinInt, + FLAGS_MAX_VALUE = kMaxInt }; #define CODE_KIND_LIST(V) \ @@ -4644,9 +4644,6 @@ class Code: public HeapObject { // Signed field cannot be encoded using the BitField class. static const int kArgumentsCountShift = 14; static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); - static const int kArgumentsBits = - PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1; - static const int kMaxArguments = (1 << kArgumentsBits) - 1; // This constant should be encodable in an ARM instruction. static const int kFlagsNotUsedInLookup = diff --git a/deps/v8/src/parser.cc b/deps/v8/src/parser.cc index 6da414a..03e4b03 100644 --- a/deps/v8/src/parser.cc +++ b/deps/v8/src/parser.cc @@ -4243,7 +4243,7 @@ ZoneList* Parser::ParseArguments(bool* ok) { while (!done) { Expression* argument = ParseAssignmentExpression(true, CHECK_OK); result->Add(argument, zone()); - if (result->length() > Code::kMaxArguments) { + if (result->length() > kMaxNumFunctionParameters) { ReportMessageAt(scanner().location(), "too_many_arguments", Vector::empty()); *ok = false; @@ -4420,7 +4420,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle function_name, top_scope_->DeclareParameter(param_name, VAR); num_parameters++; - if (num_parameters > Code::kMaxArguments) { + if (num_parameters > kMaxNumFunctionParameters) { ReportMessageAt(scanner().location(), "too_many_parameters", Vector::empty()); *ok = false; diff --git a/deps/v8/src/parser.h b/deps/v8/src/parser.h index e36a9b3..93fd1b8 100644 --- a/deps/v8/src/parser.h +++ b/deps/v8/src/parser.h @@ -449,6 +449,11 @@ class Parser { Vector > args); private: + // Limit on number of function parameters is chosen arbitrarily. + // Code::Flags uses only the low 17 bits of num-parameters to + // construct a hashable id, so if more than 2^17 are allowed, this + // should be checked. + static const int kMaxNumFunctionParameters = 32766; static const int kMaxNumFunctionLocals = 131071; // 2^17-1 enum Mode { diff --git a/deps/v8/src/platform-posix.cc b/deps/v8/src/platform-posix.cc index ad74eba..3bc8373 100644 --- a/deps/v8/src/platform-posix.cc +++ b/deps/v8/src/platform-posix.cc @@ -109,26 +109,11 @@ void* OS::GetRandomMmapAddr() { raw_addr &= V8_UINT64_C(0x3ffffffff000); #else uint32_t raw_addr = V8::RandomPrivate(isolate); - - raw_addr &= 0x3ffff000; - -# ifdef __sun - // For our Solaris/illumos mmap hint, we pick a random address in the bottom - // half of the top half of the address space (that is, the third quarter). - // Because we do not MAP_FIXED, this will be treated only as a hint -- the - // system will not fail to mmap() because something else happens to already - // be mapped at our random address. We deliberately set the hint high enough - // to get well above the system's break (that is, the heap); Solaris and - // illumos will try the hint and if that fails allocate as if there were - // no hint at all. The high hint prevents the break from getting hemmed in - // at low values, ceding half of the address space to the system heap. - raw_addr += 0x80000000; -# else // The range 0x20000000 - 0x60000000 is relatively unpopulated across a // variety of ASLR modes (PAE kernel, NX compat mode, etc) and on macos // 10.6 and 10.7. + raw_addr &= 0x3ffff000; raw_addr += 0x20000000; -# endif #endif return reinterpret_cast(raw_addr); } diff --git a/deps/v8/src/stub-cache.cc b/deps/v8/src/stub-cache.cc index 8490c7e..4119147 100644 --- a/deps/v8/src/stub-cache.cc +++ b/deps/v8/src/stub-cache.cc @@ -617,7 +617,7 @@ Handle StubCache::ComputeCallConstant(int argc, Handle code = compiler.CompileCallConstant(object, holder, function, name, check); code->set_check_type(check); - ASSERT(flags == code->flags()); + ASSERT_EQ(flags, code->flags()); PROFILE(isolate_, CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); @@ -655,7 +655,7 @@ Handle StubCache::ComputeCallField(int argc, Handle code = compiler.CompileCallField(Handle::cast(object), holder, index, name); - ASSERT(flags == code->flags()); + ASSERT_EQ(flags, code->flags()); PROFILE(isolate_, CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); @@ -692,7 +692,7 @@ Handle StubCache::ComputeCallInterceptor(int argc, Handle code = compiler.CompileCallInterceptor(Handle::cast(object), holder, name); - ASSERT(flags == code->flags()); + ASSERT_EQ(flags, code->flags()); PROFILE(isolate(), CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); @@ -721,7 +721,7 @@ Handle StubCache::ComputeCallGlobal(int argc, CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); Handle code = compiler.CompileCallGlobal(receiver, holder, cell, function, name); - ASSERT(flags == code->flags()); + ASSERT_EQ(flags, code->flags()); PROFILE(isolate(), CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); diff --git a/deps/v8/src/v8utils.h b/deps/v8/src/v8utils.h index 111abdf..9072b4e 100644 --- a/deps/v8/src/v8utils.h +++ b/deps/v8/src/v8utils.h @@ -209,8 +209,6 @@ INLINE(void CopyChars(sinkchar* dest, const sourcechar* src, int chars)); template void CopyChars(sinkchar* dest, const sourcechar* src, int chars) { - ASSERT(chars >= 0); - if (chars == 0) return; sinkchar* limit = dest + chars; #ifdef V8_HOST_CAN_READ_UNALIGNED if (sizeof(*dest) == sizeof(*src)) { diff --git a/deps/v8/src/version.cc b/deps/v8/src/version.cc index 715c2e5..f7dcbd3 100644 --- a/deps/v8/src/version.cc +++ b/deps/v8/src/version.cc @@ -35,7 +35,7 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 14 #define BUILD_NUMBER 5 -#define PATCH_LEVEL 8 +#define PATCH_LEVEL 9 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) #define IS_CANDIDATE_VERSION 0 diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index 7bee763..f59cfd3 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -76,23 +76,16 @@ consts_misc = [ { 'name': 'SmiTag', 'value': 'kSmiTag' }, { 'name': 'SmiTagMask', 'value': 'kSmiTagMask' }, { 'name': 'SmiValueShift', 'value': 'kSmiTagSize' }, - { 'name': 'SmiShiftSize', 'value': 'kSmiShiftSize' }, { 'name': 'PointerSizeLog2', 'value': 'kPointerSizeLog2' }, - { 'name': 'prop_desc_key', - 'value': 'DescriptorArray::kDescriptorKey' }, - { 'name': 'prop_desc_details', - 'value': 'DescriptorArray::kDescriptorDetails' }, - { 'name': 'prop_desc_value', - 'value': 'DescriptorArray::kDescriptorValue' }, - { 'name': 'prop_desc_size', - 'value': 'DescriptorArray::kDescriptorSize' }, + { 'name': 'prop_idx_transitions', + 'value': 'DescriptorArray::kTransitionsIndex' }, { 'name': 'prop_idx_first', 'value': 'DescriptorArray::kFirstIndex' }, { 'name': 'prop_type_field', 'value': 'FIELD' }, { 'name': 'prop_type_first_phantom', - 'value': 'Code::MAP_TRANSITION' }, + 'value': 'MAP_TRANSITION' }, { 'name': 'prop_type_mask', 'value': 'PropertyDetails::TypeField::kMask' }, @@ -114,7 +107,7 @@ extras_accessors = [ 'JSObject, elements, Object, kElementsOffset', 'FixedArray, data, uintptr_t, kHeaderSize', 'Map, instance_attributes, int, kInstanceAttributesOffset', - 'Map, transitions, uintptr_t, kTransitionsOrBackPointerOffset', + 'Map, instance_descriptors, int, kInstanceDescriptorsOrBitField3Offset', 'Map, inobject_properties, int, kInObjectPropertiesOffset', 'Map, instance_size, int, kInstanceSizeOffset', 'HeapNumber, value, double, kValueOffset', -- 2.7.4