[ 'v8_use_arm_eabi_hardfloat=="true"', {
'defines': [
'USE_EABI_HARDFLOAT=1',
- 'CAN_USE_VFP2_INSTRUCTIONS',
+ 'CAN_USE_VFP3_INSTRUCTIONS',
],
'target_conditions': [
['_toolset=="target"', {
'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': [
"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,
return false;
}
+static int fatal_exception_depth = 0;
void Isolate::DoThrow(Object* exception, MessageLocation* location) {
ASSERT(!has_pending_exception());
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.
// Parse a JSON object. Position must be right at '{'.
template <bool seq_ascii>
Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
- HandleScope scope;
Handle<Object> prototype;
Handle<JSObject> json_object =
factory()->NewJSObject(object_constructor());
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 <bool seq_ascii>
Handle<Object> JsonParser<seq_ascii>::ParseJsonArray() {
- HandleScope scope;
ZoneScope zone_scope(zone(), DELETE_ON_EXIT);
ZoneList<Handle<Object> > elements(4, zone());
ASSERT_EQ(c0_, '[');
for (int i = 0, n = elements.length(); i < n; i++) {
fast_elements->set(i, *elements[i]);
}
- Handle<Object> json_array = factory()->NewJSArrayWithElements(fast_elements);
- return scope.CloseAndEscape(json_array);
+ return factory()->NewJSArrayWithElements(fast_elements);
}
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)
// 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) \
// 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 =
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<const char*>::empty());
*ok = false;
top_scope_->DeclareParameter(param_name, VAR);
num_parameters++;
- if (num_parameters > Code::kMaxArguments) {
+ if (num_parameters > kMaxNumFunctionParameters) {
ReportMessageAt(scanner().location(), "too_many_parameters",
Vector<const char*>::empty());
*ok = false;
Vector<Handle<String> > 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 {
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<void*>(raw_addr);
}
Handle<Code> 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));
Handle<Code> code =
compiler.CompileCallField(Handle<JSObject>::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));
Handle<Code> code =
compiler.CompileCallInterceptor(Handle<JSObject>::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));
CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder);
Handle<Code> 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));
template <typename sourcechar, typename sinkchar>
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)) {
#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
{ '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' },
'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',