| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 void VirtualFrame::MergeMoveRegistersToRegisters(VirtualFrame* expected) { | 214 void VirtualFrame::MergeMoveRegistersToRegisters(VirtualFrame* expected) { |
| 215 } | 215 } |
| 216 | 216 |
| 217 | 217 |
| 218 void VirtualFrame::MergeMoveMemoryToRegisters(VirtualFrame *expected) { | 218 void VirtualFrame::MergeMoveMemoryToRegisters(VirtualFrame *expected) { |
| 219 } | 219 } |
| 220 | 220 |
| 221 | 221 |
| 222 void VirtualFrame::Enter() { | 222 void VirtualFrame::Enter() { |
| 223 Comment cmnt(masm_, "[ Enter JS frame"); | 223 Comment cmnt(masm_, "[ Enter JS frame"); |
| 224 |
| 224 #ifdef DEBUG | 225 #ifdef DEBUG |
| 225 { Label done, fail; | 226 // Verify that r1 contains a JS function. The following code relies |
| 227 // on r2 being available for use. |
| 228 { Label map_check, done; |
| 226 __ tst(r1, Operand(kSmiTagMask)); | 229 __ tst(r1, Operand(kSmiTagMask)); |
| 227 __ b(eq, &fail); | 230 __ b(ne, &map_check); |
| 231 __ stop("VirtualFrame::Enter - r1 is not a function (smi check)."); |
| 232 __ bind(&map_check); |
| 228 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); | 233 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); |
| 229 __ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); | 234 __ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); |
| 230 __ cmp(r2, Operand(JS_FUNCTION_TYPE)); | 235 __ cmp(r2, Operand(JS_FUNCTION_TYPE)); |
| 231 __ b(eq, &done); | 236 __ b(eq, &done); |
| 232 __ bind(&fail); | 237 __ stop("VirtualFrame::Enter - r1 is not a function (map check)."); |
| 233 __ stop("CodeGenerator::EnterJSFrame - r1 not a function"); | |
| 234 __ bind(&done); | 238 __ bind(&done); |
| 235 } | 239 } |
| 236 #endif // DEBUG | 240 #endif // DEBUG |
| 237 | 241 |
| 238 // We are about to push four values to the frame. | 242 // We are about to push four values to the frame. |
| 239 Adjust(4); | 243 Adjust(4); |
| 240 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 244 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 241 // Adjust FP to point to saved FP. | 245 // Adjust FP to point to saved FP. |
| 242 frame_pointer_ = elements_.length() - 2; | 246 frame_pointer_ = elements_.length() - 2; |
| 243 __ add(fp, sp, Operand(2 * kPointerSize)); | 247 __ add(fp, sp, Operand(2 * kPointerSize)); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 ASSERT(stack_pointer_ == elements_.length() - 1); | 472 ASSERT(stack_pointer_ == elements_.length() - 1); |
| 469 elements_.Add(FrameElement::MemoryElement()); | 473 elements_.Add(FrameElement::MemoryElement()); |
| 470 stack_pointer_++; | 474 stack_pointer_++; |
| 471 __ push(reg); | 475 __ push(reg); |
| 472 } | 476 } |
| 473 | 477 |
| 474 | 478 |
| 475 #undef __ | 479 #undef __ |
| 476 | 480 |
| 477 } } // namespace v8::internal | 481 } } // namespace v8::internal |
| OLD | NEW |