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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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/field-type.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/compile-time-value.h" 8 #include "src/ast/compile-time-value.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 { Comment cmnt(masm_, "[ return <undefined>;"); 348 { Comment cmnt(masm_, "[ return <undefined>;");
349 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 349 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
350 } 350 }
351 EmitReturnSequence(); 351 EmitReturnSequence();
352 352
353 // Force emit the constant pool, so it doesn't get emitted in the middle 353 // Force emit the constant pool, so it doesn't get emitted in the middle
354 // of the back edge table. 354 // of the back edge table.
355 masm()->CheckConstPool(true, false); 355 masm()->CheckConstPool(true, false);
356 } 356 }
357 357
358 void FullCodeGenerator::ClearAccumulator() { __ mov(r0, Operand(Smi::kZero)); } 358
359 void FullCodeGenerator::ClearAccumulator() {
360 __ mov(r0, Operand(Smi::FromInt(0)));
361 }
362
359 363
360 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { 364 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) {
361 __ mov(r2, Operand(profiling_counter_)); 365 __ mov(r2, Operand(profiling_counter_));
362 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset)); 366 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset));
363 __ sub(r3, r3, Operand(Smi::FromInt(delta)), SetCC); 367 __ sub(r3, r3, Operand(Smi::FromInt(delta)), SetCC);
364 __ str(r3, FieldMemOperand(r2, Cell::kValueOffset)); 368 __ str(r3, FieldMemOperand(r2, Cell::kValueOffset));
365 } 369 }
366 370
367 371
368 #ifdef CAN_USE_ARMV7_INSTRUCTIONS 372 #ifdef CAN_USE_ARMV7_INSTRUCTIONS
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 __ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); 1048 __ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
1045 __ LoadRoot(ip, Heap::kMetaMapRootIndex); 1049 __ LoadRoot(ip, Heap::kMetaMapRootIndex);
1046 __ cmp(r2, ip); 1050 __ cmp(r2, ip);
1047 __ b(ne, &fixed_array); 1051 __ b(ne, &fixed_array);
1048 1052
1049 // We got a map in register r0. Get the enumeration cache from it. 1053 // We got a map in register r0. Get the enumeration cache from it.
1050 Label no_descriptors; 1054 Label no_descriptors;
1051 __ bind(&use_cache); 1055 __ bind(&use_cache);
1052 1056
1053 __ EnumLength(r1, r0); 1057 __ EnumLength(r1, r0);
1054 __ cmp(r1, Operand(Smi::kZero)); 1058 __ cmp(r1, Operand(Smi::FromInt(0)));
1055 __ b(eq, &no_descriptors); 1059 __ b(eq, &no_descriptors);
1056 1060
1057 __ LoadInstanceDescriptors(r0, r2); 1061 __ LoadInstanceDescriptors(r0, r2);
1058 __ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheOffset)); 1062 __ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheOffset));
1059 __ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheBridgeCacheOffset)); 1063 __ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheBridgeCacheOffset));
1060 1064
1061 // Set up the four remaining stack slots. 1065 // Set up the four remaining stack slots.
1062 __ push(r0); // Map. 1066 __ push(r0); // Map.
1063 __ mov(r0, Operand(Smi::kZero)); 1067 __ mov(r0, Operand(Smi::FromInt(0)));
1064 // Push enumeration cache, enumeration cache length (as smi) and zero. 1068 // Push enumeration cache, enumeration cache length (as smi) and zero.
1065 __ Push(r2, r1, r0); 1069 __ Push(r2, r1, r0);
1066 __ jmp(&loop); 1070 __ jmp(&loop);
1067 1071
1068 __ bind(&no_descriptors); 1072 __ bind(&no_descriptors);
1069 __ Drop(1); 1073 __ Drop(1);
1070 __ jmp(&exit); 1074 __ jmp(&exit);
1071 1075
1072 // We got a fixed array in register r0. Iterate through that. 1076 // We got a fixed array in register r0. Iterate through that.
1073 __ bind(&fixed_array); 1077 __ bind(&fixed_array);
1074 1078
1075 __ mov(r1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check 1079 __ mov(r1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check
1076 __ Push(r1, r0); // Smi and array 1080 __ Push(r1, r0); // Smi and array
1077 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); 1081 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset));
1078 __ Push(r1); // Fixed array length (as smi). 1082 __ Push(r1); // Fixed array length (as smi).
1079 PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS); 1083 PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS);
1080 __ mov(r0, Operand(Smi::kZero)); 1084 __ mov(r0, Operand(Smi::FromInt(0)));
1081 __ Push(r0); // Initial index. 1085 __ Push(r0); // Initial index.
1082 1086
1083 // Generate code for doing the condition check. 1087 // Generate code for doing the condition check.
1084 __ bind(&loop); 1088 __ bind(&loop);
1085 SetExpressionAsStatementPosition(stmt->each()); 1089 SetExpressionAsStatementPosition(stmt->each());
1086 1090
1087 // Load the current count to r0, load the length to r1. 1091 // Load the current count to r0, load the length to r1.
1088 __ Ldrd(r0, r1, MemOperand(sp, 0 * kPointerSize)); 1092 __ Ldrd(r0, r1, MemOperand(sp, 0 * kPointerSize));
1089 __ cmp(r0, r1); // Compare to the array length. 1093 __ cmp(r0, r1); // Compare to the array length.
1090 __ b(hs, loop_statement.break_label()); 1094 __ b(hs, loop_statement.break_label());
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 case Token::MUL: { 1920 case Token::MUL: {
1917 __ SmiUntag(ip, right); 1921 __ SmiUntag(ip, right);
1918 __ smull(scratch1, scratch2, left, ip); 1922 __ smull(scratch1, scratch2, left, ip);
1919 __ mov(ip, Operand(scratch1, ASR, 31)); 1923 __ mov(ip, Operand(scratch1, ASR, 31));
1920 __ cmp(ip, Operand(scratch2)); 1924 __ cmp(ip, Operand(scratch2));
1921 __ b(ne, &stub_call); 1925 __ b(ne, &stub_call);
1922 __ cmp(scratch1, Operand::Zero()); 1926 __ cmp(scratch1, Operand::Zero());
1923 __ mov(right, Operand(scratch1), LeaveCC, ne); 1927 __ mov(right, Operand(scratch1), LeaveCC, ne);
1924 __ b(ne, &done); 1928 __ b(ne, &done);
1925 __ add(scratch2, right, Operand(left), SetCC); 1929 __ add(scratch2, right, Operand(left), SetCC);
1926 __ mov(right, Operand(Smi::kZero), LeaveCC, pl); 1930 __ mov(right, Operand(Smi::FromInt(0)), LeaveCC, pl);
1927 __ b(mi, &stub_call); 1931 __ b(mi, &stub_call);
1928 break; 1932 break;
1929 } 1933 }
1930 case Token::BIT_OR: 1934 case Token::BIT_OR:
1931 __ orr(right, left, Operand(right)); 1935 __ orr(right, left, Operand(right));
1932 break; 1936 break;
1933 case Token::BIT_AND: 1937 case Token::BIT_AND:
1934 __ and_(right, left, Operand(right)); 1938 __ and_(right, left, Operand(right));
1935 break; 1939 break;
1936 case Token::BIT_XOR: 1940 case Token::BIT_XOR:
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
3064 LhsKind assign_type = Property::GetAssignType(prop); 3068 LhsKind assign_type = Property::GetAssignType(prop);
3065 3069
3066 // Evaluate expression and get value. 3070 // Evaluate expression and get value.
3067 if (assign_type == VARIABLE) { 3071 if (assign_type == VARIABLE) {
3068 DCHECK(expr->expression()->AsVariableProxy()->var() != NULL); 3072 DCHECK(expr->expression()->AsVariableProxy()->var() != NULL);
3069 AccumulatorValueContext context(this); 3073 AccumulatorValueContext context(this);
3070 EmitVariableLoad(expr->expression()->AsVariableProxy()); 3074 EmitVariableLoad(expr->expression()->AsVariableProxy());
3071 } else { 3075 } else {
3072 // Reserve space for result of postfix operation. 3076 // Reserve space for result of postfix operation.
3073 if (expr->is_postfix() && !context()->IsEffect()) { 3077 if (expr->is_postfix() && !context()->IsEffect()) {
3074 __ mov(ip, Operand(Smi::kZero)); 3078 __ mov(ip, Operand(Smi::FromInt(0)));
3075 PushOperand(ip); 3079 PushOperand(ip);
3076 } 3080 }
3077 switch (assign_type) { 3081 switch (assign_type) {
3078 case NAMED_PROPERTY: { 3082 case NAMED_PROPERTY: {
3079 // Put the object both on the stack and in the register. 3083 // Put the object both on the stack and in the register.
3080 VisitForStackValue(prop->obj()); 3084 VisitForStackValue(prop->obj());
3081 __ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); 3085 __ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0));
3082 EmitNamedPropertyLoad(prop); 3086 EmitNamedPropertyLoad(prop);
3083 break; 3087 break;
3084 } 3088 }
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
3728 DCHECK(interrupt_address == 3732 DCHECK(interrupt_address ==
3729 isolate->builtins()->OnStackReplacement()->entry()); 3733 isolate->builtins()->OnStackReplacement()->entry());
3730 return ON_STACK_REPLACEMENT; 3734 return ON_STACK_REPLACEMENT;
3731 } 3735 }
3732 3736
3733 3737
3734 } // namespace internal 3738 } // namespace internal
3735 } // namespace v8 3739 } // namespace v8
3736 3740
3737 #endif // V8_TARGET_ARCH_ARM 3741 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/field-type.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698