| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 57 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 58 // Adjust fp to point to caller's fp. | 58 // Adjust fp to point to caller's fp. |
| 59 __ add(fp, sp, Operand(2 * kPointerSize)); | 59 __ add(fp, sp, Operand(2 * kPointerSize)); |
| 60 | 60 |
| 61 { Comment cmnt(masm_, "[ Allocate locals"); | 61 { Comment cmnt(masm_, "[ Allocate locals"); |
| 62 int locals_count = fun->scope()->num_stack_slots(); | 62 int locals_count = fun->scope()->num_stack_slots(); |
| 63 if (locals_count > 0) { | 63 if (locals_count > 0) { |
| 64 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 64 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 65 } | 65 } |
| 66 if (FLAG_check_stack) { | 66 __ LoadRoot(r2, Heap::kStackLimitRootIndex); |
| 67 __ LoadRoot(r2, Heap::kStackLimitRootIndex); | |
| 68 } | |
| 69 for (int i = 0; i < locals_count; i++) { | 67 for (int i = 0; i < locals_count; i++) { |
| 70 __ push(ip); | 68 __ push(ip); |
| 71 } | 69 } |
| 72 } | 70 } |
| 73 | 71 |
| 74 if (FLAG_check_stack) { | 72 // Check the stack for overflow or break request. |
| 75 // Put the lr setup instruction in the delay slot. The kInstrSize is | 73 // Put the lr setup instruction in the delay slot. The kInstrSize is |
| 76 // added to the implicit 8 byte offset that always applies to operations | 74 // added to the implicit 8 byte offset that always applies to operations |
| 77 // with pc and gives a return address 12 bytes down. | 75 // with pc and gives a return address 12 bytes down. |
| 78 Comment cmnt(masm_, "[ Stack check"); | 76 Comment cmnt(masm_, "[ Stack check"); |
| 79 __ add(lr, pc, Operand(Assembler::kInstrSize)); | 77 __ add(lr, pc, Operand(Assembler::kInstrSize)); |
| 80 __ cmp(sp, Operand(r2)); | 78 __ cmp(sp, Operand(r2)); |
| 81 StackCheckStub stub; | 79 StackCheckStub stub; |
| 82 __ mov(pc, | 80 __ mov(pc, |
| 83 Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), | 81 Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), |
| 84 RelocInfo::CODE_TARGET), | 82 RelocInfo::CODE_TARGET), |
| 85 LeaveCC, | 83 LeaveCC, |
| 86 lo); | 84 lo); |
| 87 } | |
| 88 | 85 |
| 89 { Comment cmnt(masm_, "[ Declarations"); | 86 { Comment cmnt(masm_, "[ Declarations"); |
| 90 VisitDeclarations(fun->scope()->declarations()); | 87 VisitDeclarations(fun->scope()->declarations()); |
| 91 } | 88 } |
| 92 | 89 |
| 93 if (FLAG_trace) { | 90 if (FLAG_trace) { |
| 94 __ CallRuntime(Runtime::kTraceEnter, 0); | 91 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 95 } | 92 } |
| 96 | 93 |
| 97 { Comment cmnt(masm_, "[ Body"); | 94 { Comment cmnt(masm_, "[ Body"); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 Move(destination, right->AsLiteral()); | 639 Move(destination, right->AsLiteral()); |
| 643 } else { | 640 } else { |
| 644 Visit(right); | 641 Visit(right); |
| 645 Move(destination, right->location()); | 642 Move(destination, right->location()); |
| 646 } | 643 } |
| 647 | 644 |
| 648 __ bind(&done); | 645 __ bind(&done); |
| 649 } | 646 } |
| 650 | 647 |
| 651 } } // namespace v8::internal | 648 } } // namespace v8::internal |
| OLD | NEW |