| Index: src/arm/macro-assembler-arm.cc
|
| diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
|
| index 624ba81340a6d8b31797d93bda3bb340aa0ef4de..d705c90bd2edf62c953e2ea39449ada558b277e6 100644
|
| --- a/src/arm/macro-assembler-arm.cc
|
| +++ b/src/arm/macro-assembler-arm.cc
|
| @@ -509,6 +509,7 @@ void MacroAssembler::RecordWrite(Register object,
|
| SaveFPRegsMode fp_mode,
|
| RememberedSetAction remembered_set_action,
|
| SmiCheck smi_check) {
|
| + ASSERT(!object.is(value));
|
| if (emit_debug_code()) {
|
| ldr(ip, MemOperand(address));
|
| cmp(ip, value);
|
| @@ -1639,7 +1640,7 @@ void MacroAssembler::Allocate(int object_size,
|
| Register scratch2,
|
| Label* gc_required,
|
| AllocationFlags flags) {
|
| - ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
|
| + ASSERT(object_size <= Page::kMaxRegularHeapObjectSize);
|
| if (!FLAG_inline_new) {
|
| if (emit_debug_code()) {
|
| // Trash the registers to simulate an allocation failure.
|
| @@ -2298,10 +2299,8 @@ static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
|
|
|
|
|
| void MacroAssembler::CallApiFunctionAndReturn(
|
| - ExternalReference function,
|
| - Address function_address,
|
| + Register function_address,
|
| ExternalReference thunk_ref,
|
| - Register thunk_last_arg,
|
| int stack_space,
|
| MemOperand return_value_operand,
|
| MemOperand* context_restore_operand) {
|
| @@ -2315,7 +2314,25 @@ void MacroAssembler::CallApiFunctionAndReturn(
|
| ExternalReference::handle_scope_level_address(isolate()),
|
| next_address);
|
|
|
| - ASSERT(!thunk_last_arg.is(r3));
|
| + ASSERT(function_address.is(r1) || function_address.is(r2));
|
| +
|
| + Label profiler_disabled;
|
| + Label end_profiler_check;
|
| + bool* is_profiling_flag =
|
| + isolate()->cpu_profiler()->is_profiling_address();
|
| + STATIC_ASSERT(sizeof(*is_profiling_flag) == 1);
|
| + mov(r9, Operand(reinterpret_cast<int32_t>(is_profiling_flag)));
|
| + ldrb(r9, MemOperand(r9, 0));
|
| + cmp(r9, Operand(0));
|
| + b(eq, &profiler_disabled);
|
| +
|
| + // Additional parameter is the address of the actual callback.
|
| + mov(r3, Operand(thunk_ref));
|
| + jmp(&end_profiler_check);
|
| +
|
| + bind(&profiler_disabled);
|
| + Move(r3, function_address);
|
| + bind(&end_profiler_check);
|
|
|
| // Allocate HandleScope in callee-save registers.
|
| mov(r9, Operand(next_address));
|
| @@ -2334,25 +2351,6 @@ void MacroAssembler::CallApiFunctionAndReturn(
|
| PopSafepointRegisters();
|
| }
|
|
|
| - Label profiler_disabled;
|
| - Label end_profiler_check;
|
| - bool* is_profiling_flag =
|
| - isolate()->cpu_profiler()->is_profiling_address();
|
| - STATIC_ASSERT(sizeof(*is_profiling_flag) == 1);
|
| - mov(r3, Operand(reinterpret_cast<int32_t>(is_profiling_flag)));
|
| - ldrb(r3, MemOperand(r3, 0));
|
| - cmp(r3, Operand(0));
|
| - b(eq, &profiler_disabled);
|
| -
|
| - // Additional parameter is the address of the actual callback.
|
| - mov(thunk_last_arg, Operand(reinterpret_cast<int32_t>(function_address)));
|
| - mov(r3, Operand(thunk_ref));
|
| - jmp(&end_profiler_check);
|
| -
|
| - bind(&profiler_disabled);
|
| - mov(r3, Operand(function));
|
| - bind(&end_profiler_check);
|
| -
|
| // Native call returns to the DirectCEntry stub which redirects to the
|
| // return address pushed on stack (could have moved after GC).
|
| // DirectCEntry stub itself is generated early and never moves.
|
| @@ -2808,16 +2806,8 @@ void MacroAssembler::Check(Condition cond, BailoutReason reason) {
|
| void MacroAssembler::Abort(BailoutReason reason) {
|
| Label abort_start;
|
| bind(&abort_start);
|
| - // We want to pass the msg string like a smi to avoid GC
|
| - // problems, however msg is not guaranteed to be aligned
|
| - // properly. Instead, we pass an aligned pointer that is
|
| - // a proper v8 smi, but also pass the alignment difference
|
| - // from the real pointer as a smi.
|
| - const char* msg = GetBailoutReason(reason);
|
| - intptr_t p1 = reinterpret_cast<intptr_t>(msg);
|
| - intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag;
|
| - ASSERT(reinterpret_cast<Object*>(p0)->IsSmi());
|
| #ifdef DEBUG
|
| + const char* msg = GetBailoutReason(reason);
|
| if (msg != NULL) {
|
| RecordComment("Abort message: ");
|
| RecordComment(msg);
|
| @@ -2829,25 +2819,24 @@ void MacroAssembler::Abort(BailoutReason reason) {
|
| }
|
| #endif
|
|
|
| - mov(r0, Operand(p0));
|
| - push(r0);
|
| - mov(r0, Operand(Smi::FromInt(p1 - p0)));
|
| + mov(r0, Operand(Smi::FromInt(reason)));
|
| push(r0);
|
| +
|
| // Disable stub call restrictions to always allow calls to abort.
|
| if (!has_frame_) {
|
| // We don't actually want to generate a pile of code for this, so just
|
| // claim there is a stack frame, without generating one.
|
| FrameScope scope(this, StackFrame::NONE);
|
| - CallRuntime(Runtime::kAbort, 2);
|
| + CallRuntime(Runtime::kAbort, 1);
|
| } else {
|
| - CallRuntime(Runtime::kAbort, 2);
|
| + CallRuntime(Runtime::kAbort, 1);
|
| }
|
| // will not return here
|
| if (is_const_pool_blocked()) {
|
| // If the calling code cares about the exact number of
|
| // instructions generated, we insert padding here to keep the size
|
| // of the Abort macro constant.
|
| - static const int kExpectedAbortInstructions = 10;
|
| + static const int kExpectedAbortInstructions = 7;
|
| int abort_instructions = InstructionsGeneratedSince(&abort_start);
|
| ASSERT(abort_instructions <= kExpectedAbortInstructions);
|
| while (abort_instructions++ < kExpectedAbortInstructions) {
|
| @@ -2901,31 +2890,6 @@ void MacroAssembler::LoadTransitionedArrayMapConditional(
|
| }
|
|
|
|
|
| -void MacroAssembler::LoadInitialArrayMap(
|
| - Register function_in, Register scratch,
|
| - Register map_out, bool can_have_holes) {
|
| - ASSERT(!function_in.is(map_out));
|
| - Label done;
|
| - ldr(map_out, FieldMemOperand(function_in,
|
| - JSFunction::kPrototypeOrInitialMapOffset));
|
| - if (!FLAG_smi_only_arrays) {
|
| - ElementsKind kind = can_have_holes ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS;
|
| - LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
|
| - kind,
|
| - map_out,
|
| - scratch,
|
| - &done);
|
| - } else if (can_have_holes) {
|
| - LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
|
| - FAST_HOLEY_SMI_ELEMENTS,
|
| - map_out,
|
| - scratch,
|
| - &done);
|
| - }
|
| - bind(&done);
|
| -}
|
| -
|
| -
|
| void MacroAssembler::LoadGlobalFunction(int index, Register function) {
|
| // Load the global or builtins object from the current context.
|
| ldr(function,
|
| @@ -2938,19 +2902,6 @@ void MacroAssembler::LoadGlobalFunction(int index, Register function) {
|
| }
|
|
|
|
|
| -void MacroAssembler::LoadArrayFunction(Register function) {
|
| - // Load the global or builtins object from the current context.
|
| - ldr(function,
|
| - MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
|
| - // Load the global context from the global or builtins object.
|
| - ldr(function,
|
| - FieldMemOperand(function, GlobalObject::kGlobalContextOffset));
|
| - // Load the array function from the native context.
|
| - ldr(function,
|
| - MemOperand(function, Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX)));
|
| -}
|
| -
|
| -
|
| void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
|
| Register map,
|
| Register scratch) {
|
| @@ -3434,14 +3385,14 @@ void MacroAssembler::EmitSeqStringSetCharCheck(Register string,
|
| uint32_t encoding_mask) {
|
| Label is_object;
|
| SmiTst(string);
|
| - ThrowIf(eq, kNonObject);
|
| + Check(ne, kNonObject);
|
|
|
| ldr(ip, FieldMemOperand(string, HeapObject::kMapOffset));
|
| ldrb(ip, FieldMemOperand(ip, Map::kInstanceTypeOffset));
|
|
|
| and_(ip, ip, Operand(kStringRepresentationMask | kStringEncodingMask));
|
| cmp(ip, Operand(encoding_mask));
|
| - ThrowIf(ne, kUnexpectedStringType);
|
| + Check(eq, kUnexpectedStringType);
|
|
|
| // The index is assumed to be untagged coming in, tag it to compare with the
|
| // string length without using a temp register, it is restored at the end of
|
| @@ -3450,15 +3401,15 @@ void MacroAssembler::EmitSeqStringSetCharCheck(Register string,
|
| TrySmiTag(index, index, &index_tag_bad);
|
| b(&index_tag_ok);
|
| bind(&index_tag_bad);
|
| - Throw(kIndexIsTooLarge);
|
| + Abort(kIndexIsTooLarge);
|
| bind(&index_tag_ok);
|
|
|
| ldr(ip, FieldMemOperand(string, String::kLengthOffset));
|
| cmp(index, ip);
|
| - ThrowIf(ge, kIndexIsTooLarge);
|
| + Check(lt, kIndexIsTooLarge);
|
|
|
| cmp(index, Operand(Smi::FromInt(0)));
|
| - ThrowIf(lt, kIndexIsNegative);
|
| + Check(ge, kIndexIsNegative);
|
|
|
| SmiUntag(index, index);
|
| }
|
| @@ -3926,10 +3877,16 @@ void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
|
|
|
| // Check that there are no elements. Register r2 contains the current JS
|
| // object we've reached through the prototype chain.
|
| + Label no_elements;
|
| ldr(r2, FieldMemOperand(r2, JSObject::kElementsOffset));
|
| cmp(r2, empty_fixed_array_value);
|
| + b(eq, &no_elements);
|
| +
|
| + // Second chance, the object may be using the empty slow element dictionary.
|
| + CompareRoot(r2, Heap::kEmptySlowElementDictionaryRootIndex);
|
| b(ne, call_runtime);
|
|
|
| + bind(&no_elements);
|
| ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset));
|
| cmp(r2, null_value);
|
| b(ne, &next);
|
|
|