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

Side by Side Diff: src/x87/macro-assembler-x87.cc

Issue 2396353002: Revert "Add Smi::Zero and replace all Smi::FromInt(0) calls" (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/division-by-constant.h" 8 #include "src/base/division-by-constant.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after
2930 2930
2931 // The index is assumed to be untagged coming in, tag it to compare with the 2931 // The index is assumed to be untagged coming in, tag it to compare with the
2932 // string length without using a temp register, it is restored at the end of 2932 // string length without using a temp register, it is restored at the end of
2933 // this function. 2933 // this function.
2934 SmiTag(index); 2934 SmiTag(index);
2935 Check(no_overflow, kIndexIsTooLarge); 2935 Check(no_overflow, kIndexIsTooLarge);
2936 2936
2937 cmp(index, FieldOperand(string, String::kLengthOffset)); 2937 cmp(index, FieldOperand(string, String::kLengthOffset));
2938 Check(less, kIndexIsTooLarge); 2938 Check(less, kIndexIsTooLarge);
2939 2939
2940 cmp(index, Immediate(Smi::kZero)); 2940 cmp(index, Immediate(Smi::FromInt(0)));
2941 Check(greater_equal, kIndexIsNegative); 2941 Check(greater_equal, kIndexIsNegative);
2942 2942
2943 // Restore the index 2943 // Restore the index
2944 SmiUntag(index); 2944 SmiUntag(index);
2945 } 2945 }
2946 2946
2947 2947
2948 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { 2948 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) {
2949 int frame_alignment = base::OS::ActivationFrameAlignment(); 2949 int frame_alignment = base::OS::ActivationFrameAlignment();
2950 if (frame_alignment != 0) { 2950 if (frame_alignment != 0) {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
3183 cmp(edx, Immediate(Smi::FromInt(kInvalidEnumCacheSentinel))); 3183 cmp(edx, Immediate(Smi::FromInt(kInvalidEnumCacheSentinel)));
3184 j(equal, call_runtime); 3184 j(equal, call_runtime);
3185 3185
3186 jmp(&start); 3186 jmp(&start);
3187 3187
3188 bind(&next); 3188 bind(&next);
3189 mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset)); 3189 mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset));
3190 3190
3191 // For all objects but the receiver, check that the cache is empty. 3191 // For all objects but the receiver, check that the cache is empty.
3192 EnumLength(edx, ebx); 3192 EnumLength(edx, ebx);
3193 cmp(edx, Immediate(Smi::kZero)); 3193 cmp(edx, Immediate(Smi::FromInt(0)));
3194 j(not_equal, call_runtime); 3194 j(not_equal, call_runtime);
3195 3195
3196 bind(&start); 3196 bind(&start);
3197 3197
3198 // Check that there are no elements. Register rcx contains the current JS 3198 // Check that there are no elements. Register rcx contains the current JS
3199 // object we've reached through the prototype chain. 3199 // object we've reached through the prototype chain.
3200 Label no_elements; 3200 Label no_elements;
3201 mov(ecx, FieldOperand(ecx, JSObject::kElementsOffset)); 3201 mov(ecx, FieldOperand(ecx, JSObject::kElementsOffset));
3202 cmp(ecx, isolate()->factory()->empty_fixed_array()); 3202 cmp(ecx, isolate()->factory()->empty_fixed_array());
3203 j(equal, &no_elements); 3203 j(equal, &no_elements);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
3304 mov(eax, dividend); 3304 mov(eax, dividend);
3305 shr(eax, 31); 3305 shr(eax, 31);
3306 add(edx, eax); 3306 add(edx, eax);
3307 } 3307 }
3308 3308
3309 3309
3310 } // namespace internal 3310 } // namespace internal
3311 } // namespace v8 3311 } // namespace v8
3312 3312
3313 #endif // V8_TARGET_ARCH_X87 3313 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698