| Index: src/ia32/macro-assembler-ia32.cc
|
| diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
|
| index 56a6e0e70ba3cf815edff6c10c9732cdca467eff..cc0f392f185212826144898536c1945fef233d7f 100644
|
| --- a/src/ia32/macro-assembler-ia32.cc
|
| +++ b/src/ia32/macro-assembler-ia32.cc
|
| @@ -1591,7 +1591,7 @@ void MacroAssembler::Allocate(int object_size,
|
| Label* gc_required,
|
| AllocationFlags flags) {
|
| ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0);
|
| - 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.
|
| @@ -2297,7 +2297,7 @@ void MacroAssembler::PrepareCallApiFunction(int argc) {
|
|
|
|
|
| void MacroAssembler::CallApiFunctionAndReturn(
|
| - Address function_address,
|
| + Register function_address,
|
| Address thunk_address,
|
| Operand thunk_last_arg,
|
| int stack_space,
|
| @@ -2310,6 +2310,7 @@ void MacroAssembler::CallApiFunctionAndReturn(
|
| ExternalReference level_address =
|
| ExternalReference::handle_scope_level_address(isolate());
|
|
|
| + ASSERT(edx.is(function_address));
|
| // Allocate HandleScope in callee-save registers.
|
| mov(ebx, Operand::StaticVariable(next_address));
|
| mov(edi, Operand::StaticVariable(limit_address));
|
| @@ -2336,14 +2337,14 @@ void MacroAssembler::CallApiFunctionAndReturn(
|
| j(zero, &profiler_disabled);
|
|
|
| // Additional parameter is the address of the actual getter function.
|
| - mov(thunk_last_arg, Immediate(function_address));
|
| + mov(thunk_last_arg, function_address);
|
| // Call the api function.
|
| call(thunk_address, RelocInfo::RUNTIME_ENTRY);
|
| jmp(&end_profiler_check);
|
|
|
| bind(&profiler_disabled);
|
| // Call the api function.
|
| - call(function_address, RelocInfo::RUNTIME_ENTRY);
|
| + call(function_address);
|
| bind(&end_profiler_check);
|
|
|
| if (FLAG_log_timer_events) {
|
| @@ -2688,41 +2689,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;
|
| - mov(map_out, FieldOperand(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::LoadGlobalContext(Register global_context) {
|
| - // Load the global or builtins object from the current context.
|
| - mov(global_context,
|
| - Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
|
| - // Load the native context from the global or builtins object.
|
| - mov(global_context,
|
| - FieldOperand(global_context, GlobalObject::kNativeContextOffset));
|
| -}
|
| -
|
| -
|
| void MacroAssembler::LoadGlobalFunction(int index, Register function) {
|
| // Load the global or builtins object from the current context.
|
| mov(function,
|
| @@ -2979,16 +2945,8 @@ void MacroAssembler::CheckStackAlignment() {
|
|
|
|
|
| void MacroAssembler::Abort(BailoutReason reason) {
|
| - // 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);
|
| @@ -3001,16 +2959,15 @@ void MacroAssembler::Abort(BailoutReason reason) {
|
| #endif
|
|
|
| push(eax);
|
| - push(Immediate(p0));
|
| - push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(p1 - p0))));
|
| + push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(reason))));
|
| // 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
|
| int3();
|
| @@ -3222,7 +3179,7 @@ void MacroAssembler::EmitSeqStringSetCharCheck(Register string,
|
| uint32_t encoding_mask) {
|
| Label is_object;
|
| JumpIfNotSmi(string, &is_object, Label::kNear);
|
| - Throw(kNonObject);
|
| + Abort(kNonObject);
|
| bind(&is_object);
|
|
|
| push(value);
|
| @@ -3232,20 +3189,19 @@ void MacroAssembler::EmitSeqStringSetCharCheck(Register string,
|
| and_(value, Immediate(kStringRepresentationMask | kStringEncodingMask));
|
| cmp(value, Immediate(encoding_mask));
|
| pop(value);
|
| - ThrowIf(not_equal, kUnexpectedStringType);
|
| + Check(equal, 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
|
| // this function.
|
| SmiTag(index);
|
| - // Can't use overflow here directly, compiler can't seem to disambiguate.
|
| - ThrowIf(NegateCondition(no_overflow), kIndexIsTooLarge);
|
| + Check(no_overflow, kIndexIsTooLarge);
|
|
|
| cmp(index, FieldOperand(string, String::kLengthOffset));
|
| - ThrowIf(greater_equal, kIndexIsTooLarge);
|
| + Check(less, kIndexIsTooLarge);
|
|
|
| cmp(index, Immediate(Smi::FromInt(0)));
|
| - ThrowIf(less, kIndexIsNegative);
|
| + Check(greater_equal, kIndexIsNegative);
|
|
|
| // Restore the index
|
| SmiUntag(index);
|
| @@ -3585,10 +3541,16 @@ void MacroAssembler::CheckEnumCache(Label* call_runtime) {
|
|
|
| // Check that there are no elements. Register rcx contains the current JS
|
| // object we've reached through the prototype chain.
|
| + Label no_elements;
|
| mov(ecx, FieldOperand(ecx, JSObject::kElementsOffset));
|
| cmp(ecx, isolate()->factory()->empty_fixed_array());
|
| + j(equal, &no_elements);
|
| +
|
| + // Second chance, the object may be using the empty slow element dictionary.
|
| + cmp(ecx, isolate()->factory()->empty_slow_element_dictionary());
|
| j(not_equal, call_runtime);
|
|
|
| + bind(&no_elements);
|
| mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
|
| cmp(ecx, isolate()->factory()->null_value());
|
| j(not_equal, &next);
|
|
|