| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 Slot* slot = fun->scope()->parameter(i)->slot(); | 116 Slot* slot = fun->scope()->parameter(i)->slot(); |
| 117 ASSERT(slot != NULL && slot->type() != Slot::CONTEXT); | 117 ASSERT(slot != NULL && slot->type() != Slot::CONTEXT); |
| 118 } | 118 } |
| 119 #endif | 119 #endif |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Check the stack for overflow or break request. | 122 // Check the stack for overflow or break request. |
| 123 // Put the lr setup instruction in the delay slot. The kInstrSize is | 123 // Put the lr setup instruction in the delay slot. The kInstrSize is |
| 124 // added to the implicit 8 byte offset that always applies to operations | 124 // added to the implicit 8 byte offset that always applies to operations |
| 125 // with pc and gives a return address 12 bytes down. | 125 // with pc and gives a return address 12 bytes down. |
| 126 Comment cmnt(masm_, "[ Stack check"); | 126 { Comment cmnt(masm_, "[ Stack check"); |
| 127 __ LoadRoot(r2, Heap::kStackLimitRootIndex); | 127 __ LoadRoot(r2, Heap::kStackLimitRootIndex); |
| 128 __ add(lr, pc, Operand(Assembler::kInstrSize)); | 128 __ add(lr, pc, Operand(Assembler::kInstrSize)); |
| 129 __ cmp(sp, Operand(r2)); | 129 __ cmp(sp, Operand(r2)); |
| 130 StackCheckStub stub; | 130 StackCheckStub stub; |
| 131 __ mov(pc, | 131 __ mov(pc, |
| 132 Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), | 132 Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), |
| 133 RelocInfo::CODE_TARGET), | 133 RelocInfo::CODE_TARGET), |
| 134 LeaveCC, | 134 LeaveCC, |
| 135 lo); | 135 lo); |
| 136 } |
| 136 | 137 |
| 137 { Comment cmnt(masm_, "[ Declarations"); | 138 { Comment cmnt(masm_, "[ Declarations"); |
| 138 VisitDeclarations(fun->scope()->declarations()); | 139 VisitDeclarations(fun->scope()->declarations()); |
| 139 } | 140 } |
| 140 | 141 |
| 141 if (FLAG_trace) { | 142 if (FLAG_trace) { |
| 142 __ CallRuntime(Runtime::kTraceEnter, 0); | 143 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 143 } | 144 } |
| 144 | 145 |
| 145 { Comment cmnt(masm_, "[ Body"); | 146 { Comment cmnt(masm_, "[ Body"); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 __ push(source); | 320 __ push(source); |
| 320 __ CallRuntime(Runtime::kToBool, 1); | 321 __ CallRuntime(Runtime::kToBool, 1); |
| 321 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 322 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 322 __ cmp(r0, ip); | 323 __ cmp(r0, ip); |
| 323 __ b(eq, true_label); | 324 __ b(eq, true_label); |
| 324 __ jmp(false_label); | 325 __ jmp(false_label); |
| 325 } | 326 } |
| 326 | 327 |
| 327 | 328 |
| 328 void FastCodeGenerator::VisitDeclaration(Declaration* decl) { | 329 void FastCodeGenerator::VisitDeclaration(Declaration* decl) { |
| 330 Comment cmnt(masm_, "[ Declaration"); |
| 329 Variable* var = decl->proxy()->var(); | 331 Variable* var = decl->proxy()->var(); |
| 330 ASSERT(var != NULL); // Must have been resolved. | 332 ASSERT(var != NULL); // Must have been resolved. |
| 331 Slot* slot = var->slot(); | 333 Slot* slot = var->slot(); |
| 332 ASSERT(slot != NULL); // No global declarations here. | 334 ASSERT(slot != NULL); // No global declarations here. |
| 333 | 335 |
| 334 // We have 3 cases for slots: LOOKUP, LOCAL, CONTEXT. | 336 // We have 3 cases for slots: LOOKUP, LOCAL, CONTEXT. |
| 335 switch (slot->type()) { | 337 switch (slot->type()) { |
| 336 case Slot::LOOKUP: { | 338 case Slot::LOOKUP: { |
| 337 __ mov(r2, Operand(var->name())); | 339 __ mov(r2, Operand(var->name())); |
| 338 // Declaration nodes are always introduced in one of two modes. | 340 // Declaration nodes are always introduced in one of two modes. |
| (...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 true_label_ = saved_true; | 1565 true_label_ = saved_true; |
| 1564 false_label_ = saved_false; | 1566 false_label_ = saved_false; |
| 1565 // Convert current context to test context: End post-test code. | 1567 // Convert current context to test context: End post-test code. |
| 1566 } | 1568 } |
| 1567 | 1569 |
| 1568 | 1570 |
| 1569 #undef __ | 1571 #undef __ |
| 1570 | 1572 |
| 1571 | 1573 |
| 1572 } } // namespace v8::internal | 1574 } } // namespace v8::internal |
| OLD | NEW |