Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(887)

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 10834085: Fix full code generator to not use --debug-code if it is in (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 Split(eq, if_true, if_false, NULL); 778 Split(eq, if_true, if_false, NULL);
779 __ bind(&skip); 779 __ bind(&skip);
780 } 780 }
781 } 781 }
782 782
783 783
784 void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { 784 void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) {
785 // The variable in the declaration always resides in the current function 785 // The variable in the declaration always resides in the current function
786 // context. 786 // context.
787 ASSERT_EQ(0, scope()->ContextChainLength(variable->scope())); 787 ASSERT_EQ(0, scope()->ContextChainLength(variable->scope()));
788 if (FLAG_debug_code) { 788 if (generate_debug_code_) {
789 // Check that we're not inside a with or catch context. 789 // Check that we're not inside a with or catch context.
790 __ ldr(r1, FieldMemOperand(cp, HeapObject::kMapOffset)); 790 __ ldr(r1, FieldMemOperand(cp, HeapObject::kMapOffset));
791 __ CompareRoot(r1, Heap::kWithContextMapRootIndex); 791 __ CompareRoot(r1, Heap::kWithContextMapRootIndex);
792 __ Check(ne, "Declaration in with context."); 792 __ Check(ne, "Declaration in with context.");
793 __ CompareRoot(r1, Heap::kCatchContextMapRootIndex); 793 __ CompareRoot(r1, Heap::kCatchContextMapRootIndex);
794 __ Check(ne, "Declaration in catch context."); 794 __ Check(ne, "Declaration in catch context.");
795 } 795 }
796 } 796 }
797 797
798 798
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 __ RecordWriteContextSlot( 2140 __ RecordWriteContextSlot(
2141 r1, offset, r3, r2, kLRHasBeenSaved, kDontSaveFPRegs); 2141 r1, offset, r3, r2, kLRHasBeenSaved, kDontSaveFPRegs);
2142 } 2142 }
2143 } 2143 }
2144 2144
2145 } else if (!var->is_const_mode() || op == Token::INIT_CONST_HARMONY) { 2145 } else if (!var->is_const_mode() || op == Token::INIT_CONST_HARMONY) {
2146 // Assignment to var or initializing assignment to let/const 2146 // Assignment to var or initializing assignment to let/const
2147 // in harmony mode. 2147 // in harmony mode.
2148 if (var->IsStackAllocated() || var->IsContextSlot()) { 2148 if (var->IsStackAllocated() || var->IsContextSlot()) {
2149 MemOperand location = VarOperand(var, r1); 2149 MemOperand location = VarOperand(var, r1);
2150 if (FLAG_debug_code && op == Token::INIT_LET) { 2150 if (generate_debug_code_ && op == Token::INIT_LET) {
2151 // Check for an uninitialized let binding. 2151 // Check for an uninitialized let binding.
2152 __ ldr(r2, location); 2152 __ ldr(r2, location);
2153 __ CompareRoot(r2, Heap::kTheHoleValueRootIndex); 2153 __ CompareRoot(r2, Heap::kTheHoleValueRootIndex);
2154 __ Check(eq, "Let binding re-initialization."); 2154 __ Check(eq, "Let binding re-initialization.");
2155 } 2155 }
2156 // Perform the assignment. 2156 // Perform the assignment.
2157 __ str(r0, location); 2157 __ str(r0, location);
2158 if (var->IsContextSlot()) { 2158 if (var->IsContextSlot()) {
2159 __ mov(r3, r0); 2159 __ mov(r3, r0);
2160 int offset = Context::SlotOffset(var->index()); 2160 int offset = Context::SlotOffset(var->index());
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
2704 2704
2705 VisitForAccumulatorValue(args->at(0)); 2705 VisitForAccumulatorValue(args->at(0));
2706 2706
2707 Label materialize_true, materialize_false; 2707 Label materialize_true, materialize_false;
2708 Label* if_true = NULL; 2708 Label* if_true = NULL;
2709 Label* if_false = NULL; 2709 Label* if_false = NULL;
2710 Label* fall_through = NULL; 2710 Label* fall_through = NULL;
2711 context()->PrepareTest(&materialize_true, &materialize_false, 2711 context()->PrepareTest(&materialize_true, &materialize_false,
2712 &if_true, &if_false, &fall_through); 2712 &if_true, &if_false, &fall_through);
2713 2713
2714 if (FLAG_debug_code) __ AbortIfSmi(r0); 2714 if (generate_debug_code_) __ AbortIfSmi(r0);
2715 2715
2716 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); 2716 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
2717 __ ldrb(ip, FieldMemOperand(r1, Map::kBitField2Offset)); 2717 __ ldrb(ip, FieldMemOperand(r1, Map::kBitField2Offset));
2718 __ tst(ip, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); 2718 __ tst(ip, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf));
2719 __ b(ne, if_true); 2719 __ b(ne, if_true);
2720 2720
2721 // Check for fast case object. Generate false result for slow case object. 2721 // Check for fast case object. Generate false result for slow case object.
2722 __ ldr(r2, FieldMemOperand(r0, JSObject::kPropertiesOffset)); 2722 __ ldr(r2, FieldMemOperand(r0, JSObject::kPropertiesOffset));
2723 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); 2723 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset));
2724 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); 2724 __ LoadRoot(ip, Heap::kHashTableMapRootIndex);
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
3568 3568
3569 context()->Plug(if_true, if_false); 3569 context()->Plug(if_true, if_false);
3570 } 3570 }
3571 3571
3572 3572
3573 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) { 3573 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) {
3574 ZoneList<Expression*>* args = expr->arguments(); 3574 ZoneList<Expression*>* args = expr->arguments();
3575 ASSERT(args->length() == 1); 3575 ASSERT(args->length() == 1);
3576 VisitForAccumulatorValue(args->at(0)); 3576 VisitForAccumulatorValue(args->at(0));
3577 3577
3578 if (FLAG_debug_code) { 3578 if (generate_debug_code_) {
3579 __ AbortIfNotString(r0); 3579 __ AbortIfNotString(r0);
3580 } 3580 }
3581 3581
3582 __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset)); 3582 __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset));
3583 __ IndexFromHash(r0, r0); 3583 __ IndexFromHash(r0, r0);
3584 3584
3585 context()->Plug(r0); 3585 context()->Plug(r0);
3586 } 3586 }
3587 3587
3588 3588
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
3642 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 3642 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
3643 __ add(elements_end, element, Operand(array_length, LSL, kPointerSizeLog2)); 3643 __ add(elements_end, element, Operand(array_length, LSL, kPointerSizeLog2));
3644 // Loop condition: while (element < elements_end). 3644 // Loop condition: while (element < elements_end).
3645 // Live values in registers: 3645 // Live values in registers:
3646 // elements: Fixed array of strings. 3646 // elements: Fixed array of strings.
3647 // array_length: Length of the fixed array of strings (not smi) 3647 // array_length: Length of the fixed array of strings (not smi)
3648 // separator: Separator string 3648 // separator: Separator string
3649 // string_length: Accumulated sum of string lengths (smi). 3649 // string_length: Accumulated sum of string lengths (smi).
3650 // element: Current array element. 3650 // element: Current array element.
3651 // elements_end: Array end. 3651 // elements_end: Array end.
3652 if (FLAG_debug_code) { 3652 if (generate_debug_code_) {
3653 __ cmp(array_length, Operand(0)); 3653 __ cmp(array_length, Operand(0));
3654 __ Assert(gt, "No empty arrays here in EmitFastAsciiArrayJoin"); 3654 __ Assert(gt, "No empty arrays here in EmitFastAsciiArrayJoin");
3655 } 3655 }
3656 __ bind(&loop); 3656 __ bind(&loop);
3657 __ ldr(string, MemOperand(element, kPointerSize, PostIndex)); 3657 __ ldr(string, MemOperand(element, kPointerSize, PostIndex));
3658 __ JumpIfSmi(string, &bailout); 3658 __ JumpIfSmi(string, &bailout);
3659 __ ldr(scratch1, FieldMemOperand(string, HeapObject::kMapOffset)); 3659 __ ldr(scratch1, FieldMemOperand(string, HeapObject::kMapOffset));
3660 __ ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset)); 3660 __ ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset));
3661 __ JumpIfInstanceTypeIsNotSequentialAscii(scratch1, scratch2, &bailout); 3661 __ JumpIfInstanceTypeIsNotSequentialAscii(scratch1, scratch2, &bailout);
3662 __ ldr(scratch1, FieldMemOperand(string, SeqAsciiString::kLengthOffset)); 3662 __ ldr(scratch1, FieldMemOperand(string, SeqAsciiString::kLengthOffset));
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
4570 *context_length = 0; 4570 *context_length = 0;
4571 return previous_; 4571 return previous_;
4572 } 4572 }
4573 4573
4574 4574
4575 #undef __ 4575 #undef __
4576 4576
4577 } } // namespace v8::internal 4577 } } // namespace v8::internal
4578 4578
4579 #endif // V8_TARGET_ARCH_ARM 4579 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/compiler.cc » ('j') | src/x64/assembler-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698