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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 __ mov(eax, Immediate(Factory::the_hole_value())); | 373 __ mov(eax, Immediate(Factory::the_hole_value())); |
374 if (FLAG_debug_code) { | 374 if (FLAG_debug_code) { |
375 // Check if we have the correct context pointer. | 375 // Check if we have the correct context pointer. |
376 __ mov(ebx, | 376 __ mov(ebx, |
377 CodeGenerator::ContextOperand(esi, Context::FCONTEXT_INDEX)); | 377 CodeGenerator::ContextOperand(esi, Context::FCONTEXT_INDEX)); |
378 __ cmp(ebx, Operand(esi)); | 378 __ cmp(ebx, Operand(esi)); |
379 __ Check(equal, "Unexpected declaration in current context."); | 379 __ Check(equal, "Unexpected declaration in current context."); |
380 } | 380 } |
381 __ mov(CodeGenerator::ContextOperand(esi, slot->index()), eax); | 381 __ mov(CodeGenerator::ContextOperand(esi, slot->index()), eax); |
382 // No write barrier since the_hole_value is in old space. | 382 // No write barrier since the_hole_value is in old space. |
| 383 ASSERT(!Heap::InNewSpace(*Factory::the_hole_value())); |
383 } else if (decl->fun() != NULL) { | 384 } else if (decl->fun() != NULL) { |
384 Visit(decl->fun()); | 385 Visit(decl->fun()); |
385 __ pop(eax); | 386 __ pop(eax); |
386 if (FLAG_debug_code) { | 387 if (FLAG_debug_code) { |
387 // Check if we have the correct context pointer. | 388 // Check if we have the correct context pointer. |
388 __ mov(ebx, | 389 __ mov(ebx, |
389 CodeGenerator::ContextOperand(esi, Context::FCONTEXT_INDEX)); | 390 CodeGenerator::ContextOperand(esi, Context::FCONTEXT_INDEX)); |
390 __ cmp(ebx, Operand(esi)); | 391 __ cmp(ebx, Operand(esi)); |
391 __ Check(equal, "Unexpected declaration in current context."); | 392 __ Check(equal, "Unexpected declaration in current context."); |
392 } | 393 } |
393 __ mov(CodeGenerator::ContextOperand(esi, slot->index()), eax); | 394 __ mov(CodeGenerator::ContextOperand(esi, slot->index()), eax); |
394 int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize; | 395 int offset = Context::SlotOffset(slot->index()); |
395 __ RecordWrite(esi, offset, eax, ecx); | 396 __ RecordWrite(esi, offset, eax, ecx); |
396 } | 397 } |
397 break; | 398 break; |
398 default: | 399 default: |
399 UNREACHABLE(); | 400 UNREACHABLE(); |
400 } | 401 } |
401 } | 402 } |
402 | 403 |
403 | 404 |
404 void FastCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 405 void FastCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 true_label_ = saved_true; | 1546 true_label_ = saved_true; |
1546 false_label_ = saved_false; | 1547 false_label_ = saved_false; |
1547 // Convert current context to test context: End post-test code. | 1548 // Convert current context to test context: End post-test code. |
1548 } | 1549 } |
1549 | 1550 |
1550 | 1551 |
1551 #undef __ | 1552 #undef __ |
1552 | 1553 |
1553 | 1554 |
1554 } } // namespace v8::internal | 1555 } } // namespace v8::internal |
OLD | NEW |