OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2367 LoadRoot(kScratchRegister, Heap::kConsAsciiStringMapRootIndex); | 2367 LoadRoot(kScratchRegister, Heap::kConsAsciiStringMapRootIndex); |
2368 movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); | 2368 movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); |
2369 } | 2369 } |
2370 | 2370 |
2371 | 2371 |
2372 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { | 2372 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { |
2373 if (context_chain_length > 0) { | 2373 if (context_chain_length > 0) { |
2374 // Move up the chain of contexts to the context containing the slot. | 2374 // Move up the chain of contexts to the context containing the slot. |
2375 movq(dst, Operand(rsi, Context::SlotOffset(Context::CLOSURE_INDEX))); | 2375 movq(dst, Operand(rsi, Context::SlotOffset(Context::CLOSURE_INDEX))); |
2376 // Load the function context (which is the incoming, outer context). | 2376 // Load the function context (which is the incoming, outer context). |
2377 movq(rax, FieldOperand(rax, JSFunction::kContextOffset)); | 2377 movq(dst, FieldOperand(dst, JSFunction::kContextOffset)); |
2378 for (int i = 1; i < context_chain_length; i++) { | 2378 for (int i = 1; i < context_chain_length; i++) { |
2379 movq(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX))); | 2379 movq(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX))); |
2380 movq(dst, FieldOperand(dst, JSFunction::kContextOffset)); | 2380 movq(dst, FieldOperand(dst, JSFunction::kContextOffset)); |
2381 } | 2381 } |
2382 // The context may be an intermediate context, not a function context. | 2382 // The context may be an intermediate context, not a function context. |
2383 movq(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX))); | 2383 movq(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX))); |
2384 } else { // context is the current function context. | 2384 } else { // context is the current function context. |
2385 // The context may be an intermediate context, not a function context. | 2385 // The context may be an intermediate context, not a function context. |
2386 movq(dst, Operand(rsi, Context::SlotOffset(Context::FCONTEXT_INDEX))); | 2386 movq(dst, Operand(rsi, Context::SlotOffset(Context::FCONTEXT_INDEX))); |
2387 } | 2387 } |
(...skipping 12 matching lines...) Expand all Loading... |
2400 CodePatcher::~CodePatcher() { | 2400 CodePatcher::~CodePatcher() { |
2401 // Indicate that code has changed. | 2401 // Indicate that code has changed. |
2402 CPU::FlushICache(address_, size_); | 2402 CPU::FlushICache(address_, size_); |
2403 | 2403 |
2404 // Check that the code was patched as expected. | 2404 // Check that the code was patched as expected. |
2405 ASSERT(masm_.pc_ == address_ + size_); | 2405 ASSERT(masm_.pc_ == address_ + size_); |
2406 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2406 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2407 } | 2407 } |
2408 | 2408 |
2409 } } // namespace v8::internal | 2409 } } // namespace v8::internal |
OLD | NEW |