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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 __ str(r0, MemOperand(fp, SlotOffset(var->slot()))); | 369 __ str(r0, MemOperand(fp, SlotOffset(var->slot()))); |
370 } | 370 } |
371 break; | 371 break; |
372 case Slot::CONTEXT: | 372 case Slot::CONTEXT: |
373 // The variable in the decl always resides in the current context. | 373 // The variable in the decl always resides in the current context. |
374 ASSERT(function_->scope()->ContextChainLength(slot->var()->scope()) == 0); | 374 ASSERT(function_->scope()->ContextChainLength(slot->var()->scope()) == 0); |
375 if (decl->mode() == Variable::CONST) { | 375 if (decl->mode() == Variable::CONST) { |
376 __ mov(r0, Operand(Factory::the_hole_value())); | 376 __ mov(r0, Operand(Factory::the_hole_value())); |
377 if (FLAG_debug_code) { | 377 if (FLAG_debug_code) { |
378 // Check if we have the correct context pointer. | 378 // Check if we have the correct context pointer. |
379 __ ldr(r1, CodeGenerator::ContextOperand( | 379 __ ldr(r1, CodeGenerator::ContextOperand(cp, |
380 cp, Context::FCONTEXT_INDEX)); | 380 Context::FCONTEXT_INDEX)); |
381 __ cmp(r1, cp); | 381 __ cmp(r1, cp); |
382 __ Check(eq, "Unexpected declaration in current context."); | 382 __ Check(eq, "Unexpected declaration in current context."); |
383 } | 383 } |
384 __ str(r0, CodeGenerator::ContextOperand(cp, slot->index())); | 384 __ str(r0, CodeGenerator::ContextOperand(cp, slot->index())); |
385 // No write barrier since the_hole_value is in old space. | 385 // No write barrier since the_hole_value is in old space. |
386 ASSERT(Heap::InNewSpace(*Factory::the_hole_value())); | 386 ASSERT(!Heap::InNewSpace(*Factory::the_hole_value())); |
Mads Ager (chromium)
2009/11/24 14:46:32
Could you add a regression test for this? Somethi
Lasse Reichstein
2009/11/25 08:56:26
The code is currently unreachable since we don't f
| |
387 } else if (decl->fun() != NULL) { | 387 } else if (decl->fun() != NULL) { |
388 Visit(decl->fun()); | 388 Visit(decl->fun()); |
389 __ pop(r0); | 389 __ pop(r0); |
390 if (FLAG_debug_code) { | 390 if (FLAG_debug_code) { |
391 // Check if we have the correct context pointer. | 391 // Check if we have the correct context pointer. |
392 __ ldr(r1, CodeGenerator::ContextOperand( | 392 __ ldr(r1, CodeGenerator::ContextOperand(cp, |
393 cp, Context::FCONTEXT_INDEX)); | 393 Context::FCONTEXT_INDEX)); |
394 __ cmp(r1, cp); | 394 __ cmp(r1, cp); |
395 __ Check(eq, "Unexpected declaration in current context."); | 395 __ Check(eq, "Unexpected declaration in current context."); |
396 } | 396 } |
397 __ str(r0, CodeGenerator::ContextOperand(cp, slot->index())); | 397 __ str(r0, CodeGenerator::ContextOperand(cp, slot->index())); |
398 int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize; | 398 int offset = Context::SlotOffset(slot->index()); |
399 __ mov(r2, Operand(offset)); | 399 __ mov(r2, Operand(offset)); |
400 // We know that we have written a function, which is not a smi. | 400 // We know that we have written a function, which is not a smi. |
401 __ RecordWrite(cp, r2, r0); | 401 __ RecordWrite(cp, r2, r0); |
402 } | 402 } |
403 break; | 403 break; |
404 default: | 404 default: |
405 UNREACHABLE(); | 405 UNREACHABLE(); |
406 } | 406 } |
407 } | 407 } |
408 | 408 |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1565 true_label_ = saved_true; | 1565 true_label_ = saved_true; |
1566 false_label_ = saved_false; | 1566 false_label_ = saved_false; |
1567 // Convert current context to test context: End post-test code. | 1567 // Convert current context to test context: End post-test code. |
1568 } | 1568 } |
1569 | 1569 |
1570 | 1570 |
1571 #undef __ | 1571 #undef __ |
1572 | 1572 |
1573 | 1573 |
1574 } } // namespace v8::internal | 1574 } } // namespace v8::internal |
OLD | NEW |