| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 17 matching lines...) Expand all Loading... |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #include "bootstrapper.h" | 30 #include "bootstrapper.h" |
| 31 #include "codegen-inl.h" | 31 #include "codegen-inl.h" |
| 32 #include "debug.h" | 32 #include "debug.h" |
| 33 #include "runtime.h" | 33 #include "runtime.h" |
| 34 | 34 |
| 35 namespace v8 { | 35 namespace v8 { |
| 36 namespace internal { | 36 namespace internal { |
| 37 | 37 |
| 38 // Give alias names to registers | |
| 39 Register cp = { 8 }; // JavaScript context pointer | |
| 40 Register pp = { 10 }; // parameter pointer | |
| 41 | |
| 42 | |
| 43 MacroAssembler::MacroAssembler(void* buffer, int size) | 38 MacroAssembler::MacroAssembler(void* buffer, int size) |
| 44 : Assembler(buffer, size), | 39 : Assembler(buffer, size), |
| 45 unresolved_(0), | 40 unresolved_(0), |
| 46 generating_stub_(false), | 41 generating_stub_(false), |
| 47 allow_stub_calls_(true), | 42 allow_stub_calls_(true), |
| 48 code_object_(Heap::undefined_value()) { | 43 code_object_(Heap::undefined_value()) { |
| 49 } | 44 } |
| 50 | 45 |
| 51 | 46 |
| 52 // We always generate arm code, never thumb code, even if V8 is compiled to | 47 // We always generate arm code, never thumb code, even if V8 is compiled to |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 273 |
| 279 | 274 |
| 280 void MacroAssembler::EnterExitFrame(StackFrame::Type type) { | 275 void MacroAssembler::EnterExitFrame(StackFrame::Type type) { |
| 281 ASSERT(type == StackFrame::EXIT || type == StackFrame::EXIT_DEBUG); | 276 ASSERT(type == StackFrame::EXIT || type == StackFrame::EXIT_DEBUG); |
| 282 | 277 |
| 283 // Compute the argv pointer and keep it in a callee-saved register. | 278 // Compute the argv pointer and keep it in a callee-saved register. |
| 284 // r0 is argc. | 279 // r0 is argc. |
| 285 add(r6, sp, Operand(r0, LSL, kPointerSizeLog2)); | 280 add(r6, sp, Operand(r0, LSL, kPointerSizeLog2)); |
| 286 sub(r6, r6, Operand(kPointerSize)); | 281 sub(r6, r6, Operand(kPointerSize)); |
| 287 | 282 |
| 288 // Compute parameter pointer before making changes and save it as ip | 283 // Compute callee's stack pointer before making changes and save it as |
| 289 // register so that it is restored as sp register on exit, thereby | 284 // ip register so that it is restored as sp register on exit, thereby |
| 290 // popping the args. | 285 // popping the args. |
| 291 | 286 |
| 292 // ip = sp + kPointerSize * #args; | 287 // ip = sp + kPointerSize * #args; |
| 293 add(ip, sp, Operand(r0, LSL, kPointerSizeLog2)); | 288 add(ip, sp, Operand(r0, LSL, kPointerSizeLog2)); |
| 294 | 289 |
| 295 // Align the stack at this point. After this point we have 5 pushes, | 290 // Align the stack at this point. After this point we have 5 pushes, |
| 296 // so in fact we have to unalign here! See also the assert on the | 291 // so in fact we have to unalign here! See also the assert on the |
| 297 // alignment immediately below. | 292 // alignment immediately below. |
| 298 if (OS::ActivationFrameAlignment() != kPointerSize) { | 293 if (OS::ActivationFrameAlignment() != kPointerSize) { |
| 299 // This code needs to be made more general if this assert doesn't hold. | 294 // This code needs to be made more general if this assert doesn't hold. |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 #endif | 992 #endif |
| 998 mov(r0, Operand(p0)); | 993 mov(r0, Operand(p0)); |
| 999 push(r0); | 994 push(r0); |
| 1000 mov(r0, Operand(Smi::FromInt(p1 - p0))); | 995 mov(r0, Operand(Smi::FromInt(p1 - p0))); |
| 1001 push(r0); | 996 push(r0); |
| 1002 CallRuntime(Runtime::kAbort, 2); | 997 CallRuntime(Runtime::kAbort, 2); |
| 1003 // will not return here | 998 // will not return here |
| 1004 } | 999 } |
| 1005 | 1000 |
| 1006 } } // namespace v8::internal | 1001 } } // namespace v8::internal |
| OLD | NEW |