Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(888)

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 7044081: Use the previous context link when checking context extension objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3553 matching lines...) Expand 10 before | Expand all | Expand 10 after
3564 while (abort_instructions++ < kExpectedAbortInstructions) { 3564 while (abort_instructions++ < kExpectedAbortInstructions) {
3565 nop(); 3565 nop();
3566 } 3566 }
3567 } 3567 }
3568 } 3568 }
3569 3569
3570 3570
3571 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { 3571 void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
3572 if (context_chain_length > 0) { 3572 if (context_chain_length > 0) {
3573 // Move up the chain of contexts to the context containing the slot. 3573 // Move up the chain of contexts to the context containing the slot.
3574 lw(dst, MemOperand(cp, Context::SlotOffset(Context::CLOSURE_INDEX))); 3574 lw(dst, MemOperand(cp, Context::SlotOffset(Context::PREVIOUS_INDEX)));
3575 // Load the function context (which is the incoming, outer context).
3576 lw(dst, FieldMemOperand(dst, JSFunction::kContextOffset));
3577 for (int i = 1; i < context_chain_length; i++) { 3575 for (int i = 1; i < context_chain_length; i++) {
3578 lw(dst, MemOperand(dst, Context::SlotOffset(Context::CLOSURE_INDEX))); 3576 lw(dst, MemOperand(dst, Context::SlotOffset(Context::PREVIOUS_INDEX)));
3579 lw(dst, FieldMemOperand(dst, JSFunction::kContextOffset));
3580 } 3577 }
3581 } else { 3578 } else {
3582 // Slot is in the current function context. Move it into the 3579 // Slot is in the current function context. Move it into the
3583 // destination register in case we store into it (the write barrier 3580 // destination register in case we store into it (the write barrier
3584 // cannot be allowed to destroy the context in esi). 3581 // cannot be allowed to destroy the context in esi).
3585 Move(dst, cp); 3582 Move(dst, cp);
3586 } 3583 }
3587 3584
3588 // We should not have found a 'with' context by walking the context chain 3585 // We should not have found a 'with' context by walking the context chain
3589 // (i.e., the static scope chain and runtime context chain do not agree). 3586 // (i.e., the static scope chain and runtime context chain do not agree).
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
4110 opcode == BGTZL); 4107 opcode == BGTZL);
4111 opcode = (cond == eq) ? BEQ : BNE; 4108 opcode = (cond == eq) ? BEQ : BNE;
4112 instr = (instr & ~kOpcodeMask) | opcode; 4109 instr = (instr & ~kOpcodeMask) | opcode;
4113 masm_.emit(instr); 4110 masm_.emit(instr);
4114 } 4111 }
4115 4112
4116 4113
4117 } } // namespace v8::internal 4114 } } // namespace v8::internal
4118 4115
4119 #endif // V8_TARGET_ARCH_MIPS 4116 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698