| Index: src/ia32/macro-assembler-ia32.cc
|
| ===================================================================
|
| --- src/ia32/macro-assembler-ia32.cc (revision 7006)
|
| +++ src/ia32/macro-assembler-ia32.cc (working copy)
|
| @@ -606,11 +606,11 @@
|
| ExternalReference new_space_allocation_limit =
|
| ExternalReference::new_space_allocation_limit_address();
|
|
|
| - if (top_reg.is(result)) {
|
| - add(Operand(top_reg), Immediate(object_size));
|
| - } else {
|
| - lea(top_reg, Operand(result, object_size));
|
| + if (!top_reg.is(result)) {
|
| + mov(top_reg, result);
|
| }
|
| + add(Operand(top_reg), Immediate(object_size));
|
| + j(carry, gc_required, not_taken);
|
| cmp(top_reg, Operand::StaticVariable(new_space_allocation_limit));
|
| j(above, gc_required, not_taken);
|
|
|
| @@ -659,7 +659,12 @@
|
| // Calculate new top and bail out if new space is exhausted.
|
| ExternalReference new_space_allocation_limit =
|
| ExternalReference::new_space_allocation_limit_address();
|
| - lea(result_end, Operand(result, element_count, element_size, header_size));
|
| +
|
| + // We assume that element_count*element_size + header_size does not
|
| + // overflow.
|
| + lea(result_end, Operand(element_count, element_size, header_size));
|
| + add(result_end, Operand(result));
|
| + j(carry, gc_required);
|
| cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
|
| j(above, gc_required);
|
|
|
| @@ -704,6 +709,7 @@
|
| mov(result_end, object_size);
|
| }
|
| add(result_end, Operand(result));
|
| + j(carry, gc_required, not_taken);
|
| cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
|
| j(above, gc_required, not_taken);
|
|
|
| @@ -1528,12 +1534,22 @@
|
| mov(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX)));
|
| mov(dst, FieldOperand(dst, JSFunction::kContextOffset));
|
| }
|
| - // The context may be an intermediate context, not a function context.
|
| - mov(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
|
| - } else { // Slot is in the current function context.
|
| - // The context may be an intermediate context, not a function context.
|
| - mov(dst, Operand(esi, Context::SlotOffset(Context::FCONTEXT_INDEX)));
|
| + } else {
|
| + // Slot is in the current function context. Move it into the
|
| + // destination register in case we store into it (the write barrier
|
| + // cannot be allowed to destroy the context in esi).
|
| + mov(dst, esi);
|
| }
|
| +
|
| + // We should not have found a 'with' context by walking the context chain
|
| + // (i.e., the static scope chain and runtime context chain do not agree).
|
| + // A variable occurring in such a scope should have slot type LOOKUP and
|
| + // not CONTEXT.
|
| + if (FLAG_debug_code) {
|
| + cmp(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
|
| + Check(equal, "Yo dawg, I heard you liked function contexts "
|
| + "so I put function contexts in all your contexts");
|
| + }
|
| }
|
|
|
|
|
| @@ -1576,6 +1592,20 @@
|
| }
|
|
|
|
|
| +void MacroAssembler::Ret(int bytes_dropped, Register scratch) {
|
| + if (is_uint16(bytes_dropped)) {
|
| + ret(bytes_dropped);
|
| + } else {
|
| + pop(scratch);
|
| + add(Operand(esp), Immediate(bytes_dropped));
|
| + push(scratch);
|
| + ret(0);
|
| + }
|
| +}
|
| +
|
| +
|
| +
|
| +
|
| void MacroAssembler::Drop(int stack_elements) {
|
| if (stack_elements > 0) {
|
| add(Operand(esp), Immediate(stack_elements * kPointerSize));
|
|
|