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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 232883002: Use the right kind of guard for debug code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2886 matching lines...) Expand 10 before | Expand all | Expand 10 after
2897 2897
2898 Register result = ToRegister(instr->result()); 2898 Register result = ToRegister(instr->result());
2899 if (!access.IsInobject()) { 2899 if (!access.IsInobject()) {
2900 __ movp(result, FieldOperand(object, JSObject::kPropertiesOffset)); 2900 __ movp(result, FieldOperand(object, JSObject::kPropertiesOffset));
2901 object = result; 2901 object = result;
2902 } 2902 }
2903 2903
2904 Representation representation = access.representation(); 2904 Representation representation = access.representation();
2905 if (representation.IsSmi() && SmiValuesAre32Bits() && 2905 if (representation.IsSmi() && SmiValuesAre32Bits() &&
2906 instr->hydrogen()->representation().IsInteger32()) { 2906 instr->hydrogen()->representation().IsInteger32()) {
2907 #ifdef DEBUG 2907 if (FLAG_debug_code) {
2908 Register scratch = kScratchRegister; 2908 Register scratch = kScratchRegister;
2909 __ Load(scratch, FieldOperand(object, offset), representation); 2909 __ Load(scratch, FieldOperand(object, offset), representation);
2910 __ AssertSmi(scratch); 2910 __ AssertSmi(scratch);
2911 #endif 2911 }
2912 2912
2913 // Read int value directly from upper half of the smi. 2913 // Read int value directly from upper half of the smi.
2914 STATIC_ASSERT(kSmiTag == 0); 2914 STATIC_ASSERT(kSmiTag == 0);
2915 ASSERT(kSmiTagSize + kSmiShiftSize == 32); 2915 ASSERT(kSmiTagSize + kSmiShiftSize == 32);
2916 offset += kPointerSize / 2; 2916 offset += kPointerSize / 2;
2917 representation = Representation::Integer32(); 2917 representation = Representation::Integer32();
2918 } 2918 }
2919 __ Load(result, FieldOperand(object, offset), representation); 2919 __ Load(result, FieldOperand(object, offset), representation);
2920 } 2920 }
2921 2921
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
3112 HLoadKeyed* hinstr = instr->hydrogen(); 3112 HLoadKeyed* hinstr = instr->hydrogen();
3113 Register result = ToRegister(instr->result()); 3113 Register result = ToRegister(instr->result());
3114 LOperand* key = instr->key(); 3114 LOperand* key = instr->key();
3115 bool requires_hole_check = hinstr->RequiresHoleCheck(); 3115 bool requires_hole_check = hinstr->RequiresHoleCheck();
3116 int offset = FixedArray::kHeaderSize - kHeapObjectTag; 3116 int offset = FixedArray::kHeaderSize - kHeapObjectTag;
3117 Representation representation = hinstr->representation(); 3117 Representation representation = hinstr->representation();
3118 3118
3119 if (representation.IsInteger32() && SmiValuesAre32Bits() && 3119 if (representation.IsInteger32() && SmiValuesAre32Bits() &&
3120 hinstr->elements_kind() == FAST_SMI_ELEMENTS) { 3120 hinstr->elements_kind() == FAST_SMI_ELEMENTS) {
3121 ASSERT(!requires_hole_check); 3121 ASSERT(!requires_hole_check);
3122 #ifdef DEBUG 3122 if (FLAG_debug_code) {
3123 Register scratch = kScratchRegister; 3123 Register scratch = kScratchRegister;
3124 __ Load(scratch, 3124 __ Load(scratch,
3125 BuildFastArrayOperand(instr->elements(), 3125 BuildFastArrayOperand(instr->elements(),
3126 key, 3126 key,
3127 FAST_ELEMENTS, 3127 FAST_ELEMENTS,
3128 offset, 3128 offset,
3129 instr->additional_index()), 3129 instr->additional_index()),
3130 Representation::Smi()); 3130 Representation::Smi());
3131 __ AssertSmi(scratch); 3131 __ AssertSmi(scratch);
3132 #endif 3132 }
3133 // Read int value directly from upper half of the smi. 3133 // Read int value directly from upper half of the smi.
3134 STATIC_ASSERT(kSmiTag == 0); 3134 STATIC_ASSERT(kSmiTag == 0);
3135 ASSERT(kSmiTagSize + kSmiShiftSize == 32); 3135 ASSERT(kSmiTagSize + kSmiShiftSize == 32);
3136 offset += kPointerSize / 2; 3136 offset += kPointerSize / 2;
3137 } 3137 }
3138 3138
3139 __ Load(result, 3139 __ Load(result,
3140 BuildFastArrayOperand(instr->elements(), 3140 BuildFastArrayOperand(instr->elements(),
3141 key, 3141 key,
3142 FAST_ELEMENTS, 3142 FAST_ELEMENTS,
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
4036 // Do the store. 4036 // Do the store.
4037 Register write_register = object; 4037 Register write_register = object;
4038 if (!access.IsInobject()) { 4038 if (!access.IsInobject()) {
4039 write_register = ToRegister(instr->temp()); 4039 write_register = ToRegister(instr->temp());
4040 __ movp(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); 4040 __ movp(write_register, FieldOperand(object, JSObject::kPropertiesOffset));
4041 } 4041 }
4042 4042
4043 if (representation.IsSmi() && SmiValuesAre32Bits() && 4043 if (representation.IsSmi() && SmiValuesAre32Bits() &&
4044 hinstr->value()->representation().IsInteger32()) { 4044 hinstr->value()->representation().IsInteger32()) {
4045 ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY); 4045 ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY);
4046 #ifdef DEBUG 4046 if (FLAG_debug_code) {
4047 Register scratch = kScratchRegister; 4047 Register scratch = kScratchRegister;
4048 __ Load(scratch, FieldOperand(write_register, offset), representation); 4048 __ Load(scratch, FieldOperand(write_register, offset), representation);
4049 __ AssertSmi(scratch); 4049 __ AssertSmi(scratch);
4050 #endif 4050 }
4051 // Store int value directly to upper half of the smi. 4051 // Store int value directly to upper half of the smi.
4052 STATIC_ASSERT(kSmiTag == 0); 4052 STATIC_ASSERT(kSmiTag == 0);
4053 ASSERT(kSmiTagSize + kSmiShiftSize == 32); 4053 ASSERT(kSmiTagSize + kSmiShiftSize == 32);
4054 offset += kPointerSize / 2; 4054 offset += kPointerSize / 2;
4055 representation = Representation::Integer32(); 4055 representation = Representation::Integer32();
4056 } 4056 }
4057 4057
4058 Operand operand = FieldOperand(write_register, offset); 4058 Operand operand = FieldOperand(write_register, offset);
4059 4059
4060 if (instr->value()->IsRegister()) { 4060 if (instr->value()->IsRegister()) {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
4259 4259
4260 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { 4260 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
4261 HStoreKeyed* hinstr = instr->hydrogen(); 4261 HStoreKeyed* hinstr = instr->hydrogen();
4262 LOperand* key = instr->key(); 4262 LOperand* key = instr->key();
4263 int offset = FixedArray::kHeaderSize - kHeapObjectTag; 4263 int offset = FixedArray::kHeaderSize - kHeapObjectTag;
4264 Representation representation = hinstr->value()->representation(); 4264 Representation representation = hinstr->value()->representation();
4265 4265
4266 if (representation.IsInteger32() && SmiValuesAre32Bits()) { 4266 if (representation.IsInteger32() && SmiValuesAre32Bits()) {
4267 ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY); 4267 ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY);
4268 ASSERT(hinstr->elements_kind() == FAST_SMI_ELEMENTS); 4268 ASSERT(hinstr->elements_kind() == FAST_SMI_ELEMENTS);
4269 #ifdef DEBUG 4269 if (FLAG_debug_code) {
4270 Register scratch = kScratchRegister; 4270 Register scratch = kScratchRegister;
4271 __ Load(scratch, 4271 __ Load(scratch,
4272 BuildFastArrayOperand(instr->elements(), 4272 BuildFastArrayOperand(instr->elements(),
4273 key, 4273 key,
4274 FAST_ELEMENTS, 4274 FAST_ELEMENTS,
4275 offset, 4275 offset,
4276 instr->additional_index()), 4276 instr->additional_index()),
4277 Representation::Smi()); 4277 Representation::Smi());
4278 __ AssertSmi(scratch); 4278 __ AssertSmi(scratch);
4279 #endif 4279 }
4280 // Store int value directly to upper half of the smi. 4280 // Store int value directly to upper half of the smi.
4281 STATIC_ASSERT(kSmiTag == 0); 4281 STATIC_ASSERT(kSmiTag == 0);
4282 ASSERT(kSmiTagSize + kSmiShiftSize == 32); 4282 ASSERT(kSmiTagSize + kSmiShiftSize == 32);
4283 offset += kPointerSize / 2; 4283 offset += kPointerSize / 2;
4284 } 4284 }
4285 4285
4286 Operand operand = 4286 Operand operand =
4287 BuildFastArrayOperand(instr->elements(), 4287 BuildFastArrayOperand(instr->elements(),
4288 key, 4288 key,
4289 FAST_ELEMENTS, 4289 FAST_ELEMENTS,
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after
5687 __ bind(deferred->exit()); 5687 __ bind(deferred->exit());
5688 __ bind(&done); 5688 __ bind(&done);
5689 } 5689 }
5690 5690
5691 5691
5692 #undef __ 5692 #undef __
5693 5693
5694 } } // namespace v8::internal 5694 } } // namespace v8::internal
5695 5695
5696 #endif // V8_TARGET_ARCH_X64 5696 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698