OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 #endif | 345 #endif |
346 | 346 |
347 // Clear top frame. | 347 // Clear top frame. |
348 mov(r3, Operand(0)); | 348 mov(r3, Operand(0)); |
349 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); | 349 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); |
350 str(r3, MemOperand(ip)); | 350 str(r3, MemOperand(ip)); |
351 | 351 |
352 // Restore current context from top and clear it in debug mode. | 352 // Restore current context from top and clear it in debug mode. |
353 mov(ip, Operand(ExternalReference(Top::k_context_address))); | 353 mov(ip, Operand(ExternalReference(Top::k_context_address))); |
354 ldr(cp, MemOperand(ip)); | 354 ldr(cp, MemOperand(ip)); |
355 if (kDebug) { | 355 #ifdef DEBUG |
356 str(r3, MemOperand(ip)); | 356 str(r3, MemOperand(ip)); |
357 } | 357 #endif |
358 | 358 |
359 // Pop the arguments, restore registers, and return. | 359 // Pop the arguments, restore registers, and return. |
360 mov(sp, Operand(fp)); // respect ABI stack constraint | 360 mov(sp, Operand(fp)); // respect ABI stack constraint |
361 ldm(ia, sp, fp.bit() | sp.bit() | pc.bit()); | 361 ldm(ia, sp, fp.bit() | sp.bit() | pc.bit()); |
362 } | 362 } |
363 | 363 |
364 | 364 |
365 void MacroAssembler::InvokePrologue(const ParameterCount& expected, | 365 void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
366 const ParameterCount& actual, | 366 const ParameterCount& actual, |
367 Handle<Code> code_constant, | 367 Handle<Code> code_constant, |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 Label* miss) { | 672 Label* miss) { |
673 Label same_contexts; | 673 Label same_contexts; |
674 | 674 |
675 ASSERT(!holder_reg.is(scratch)); | 675 ASSERT(!holder_reg.is(scratch)); |
676 ASSERT(!holder_reg.is(ip)); | 676 ASSERT(!holder_reg.is(ip)); |
677 ASSERT(!scratch.is(ip)); | 677 ASSERT(!scratch.is(ip)); |
678 | 678 |
679 // Load current lexical context from the stack frame. | 679 // Load current lexical context from the stack frame. |
680 ldr(scratch, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 680 ldr(scratch, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
681 // In debug mode, make sure the lexical context is set. | 681 // In debug mode, make sure the lexical context is set. |
682 if (kDebug) { | 682 #ifdef DEBUG |
683 cmp(scratch, Operand(0)); | 683 cmp(scratch, Operand(0)); |
684 Check(ne, "we should not have an empty lexical context"); | 684 Check(ne, "we should not have an empty lexical context"); |
685 } | 685 #endif |
686 | 686 |
687 // Load the global context of the current context. | 687 // Load the global context of the current context. |
688 int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; | 688 int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; |
689 ldr(scratch, FieldMemOperand(scratch, offset)); | 689 ldr(scratch, FieldMemOperand(scratch, offset)); |
690 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset)); | 690 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset)); |
691 | 691 |
692 // Check the context is a global context. | 692 // Check the context is a global context. |
693 if (FLAG_debug_code) { | 693 if (FLAG_debug_code) { |
694 // TODO(119): avoid push(holder_reg)/pop(holder_reg) | 694 // TODO(119): avoid push(holder_reg)/pop(holder_reg) |
695 // Cannot use ip as a temporary in this verification code. Due to the fact | 695 // Cannot use ip as a temporary in this verification code. Due to the fact |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 #endif | 932 #endif |
933 mov(r0, Operand(p0)); | 933 mov(r0, Operand(p0)); |
934 push(r0); | 934 push(r0); |
935 mov(r0, Operand(Smi::FromInt(p1 - p0))); | 935 mov(r0, Operand(Smi::FromInt(p1 - p0))); |
936 push(r0); | 936 push(r0); |
937 CallRuntime(Runtime::kAbort, 2); | 937 CallRuntime(Runtime::kAbort, 2); |
938 // will not return here | 938 // will not return here |
939 } | 939 } |
940 | 940 |
941 } } // namespace v8::internal | 941 } } // namespace v8::internal |
OLD | NEW |