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

Side by Side Diff: src/full-codegen/s390/full-codegen-s390.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/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x64/full-codegen-x64.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_S390 5 #if V8_TARGET_ARCH_S390
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // Always emit a 'return undefined' in case control fell off the end of 356 // Always emit a 'return undefined' in case control fell off the end of
357 // the body. 357 // the body.
358 { 358 {
359 Comment cmnt(masm_, "[ return <undefined>;"); 359 Comment cmnt(masm_, "[ return <undefined>;");
360 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 360 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
361 } 361 }
362 EmitReturnSequence(); 362 EmitReturnSequence();
363 } 363 }
364 364
365 void FullCodeGenerator::ClearAccumulator() { 365 void FullCodeGenerator::ClearAccumulator() {
366 __ LoadSmiLiteral(r2, Smi::kZero); 366 __ LoadSmiLiteral(r2, Smi::FromInt(0));
367 } 367 }
368 368
369 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { 369 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) {
370 __ mov(r4, Operand(profiling_counter_)); 370 __ mov(r4, Operand(profiling_counter_));
371 intptr_t smi_delta = reinterpret_cast<intptr_t>(Smi::FromInt(delta)); 371 intptr_t smi_delta = reinterpret_cast<intptr_t>(Smi::FromInt(delta));
372 if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT) && is_int8(-smi_delta)) { 372 if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT) && is_int8(-smi_delta)) {
373 __ AddP(FieldMemOperand(r4, Cell::kValueOffset), Operand(-smi_delta)); 373 __ AddP(FieldMemOperand(r4, Cell::kValueOffset), Operand(-smi_delta));
374 __ LoadP(r5, FieldMemOperand(r4, Cell::kValueOffset)); 374 __ LoadP(r5, FieldMemOperand(r4, Cell::kValueOffset));
375 } else { 375 } else {
376 __ LoadP(r5, FieldMemOperand(r4, Cell::kValueOffset)); 376 __ LoadP(r5, FieldMemOperand(r4, Cell::kValueOffset));
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 Label fixed_array; 977 Label fixed_array;
978 __ LoadP(r4, FieldMemOperand(r2, HeapObject::kMapOffset)); 978 __ LoadP(r4, FieldMemOperand(r2, HeapObject::kMapOffset));
979 __ CompareRoot(r4, Heap::kMetaMapRootIndex); 979 __ CompareRoot(r4, Heap::kMetaMapRootIndex);
980 __ bne(&fixed_array); 980 __ bne(&fixed_array);
981 981
982 // We got a map in register r2. Get the enumeration cache from it. 982 // We got a map in register r2. Get the enumeration cache from it.
983 Label no_descriptors; 983 Label no_descriptors;
984 __ bind(&use_cache); 984 __ bind(&use_cache);
985 985
986 __ EnumLength(r3, r2); 986 __ EnumLength(r3, r2);
987 __ CmpSmiLiteral(r3, Smi::kZero, r0); 987 __ CmpSmiLiteral(r3, Smi::FromInt(0), r0);
988 __ beq(&no_descriptors, Label::kNear); 988 __ beq(&no_descriptors, Label::kNear);
989 989
990 __ LoadInstanceDescriptors(r2, r4); 990 __ LoadInstanceDescriptors(r2, r4);
991 __ LoadP(r4, FieldMemOperand(r4, DescriptorArray::kEnumCacheOffset)); 991 __ LoadP(r4, FieldMemOperand(r4, DescriptorArray::kEnumCacheOffset));
992 __ LoadP(r4, 992 __ LoadP(r4,
993 FieldMemOperand(r4, DescriptorArray::kEnumCacheBridgeCacheOffset)); 993 FieldMemOperand(r4, DescriptorArray::kEnumCacheBridgeCacheOffset));
994 994
995 // Set up the four remaining stack slots. 995 // Set up the four remaining stack slots.
996 __ push(r2); // Map. 996 __ push(r2); // Map.
997 __ LoadSmiLiteral(r2, Smi::kZero); 997 __ LoadSmiLiteral(r2, Smi::FromInt(0));
998 // Push enumeration cache, enumeration cache length (as smi) and zero. 998 // Push enumeration cache, enumeration cache length (as smi) and zero.
999 __ Push(r4, r3, r2); 999 __ Push(r4, r3, r2);
1000 __ b(&loop); 1000 __ b(&loop);
1001 1001
1002 __ bind(&no_descriptors); 1002 __ bind(&no_descriptors);
1003 __ Drop(1); 1003 __ Drop(1);
1004 __ b(&exit); 1004 __ b(&exit);
1005 1005
1006 // We got a fixed array in register r2. Iterate through that. 1006 // We got a fixed array in register r2. Iterate through that.
1007 __ bind(&fixed_array); 1007 __ bind(&fixed_array);
1008 1008
1009 __ LoadSmiLiteral(r3, Smi::FromInt(1)); // Smi(1) indicates slow check 1009 __ LoadSmiLiteral(r3, Smi::FromInt(1)); // Smi(1) indicates slow check
1010 __ Push(r3, r2); // Smi and array 1010 __ Push(r3, r2); // Smi and array
1011 __ LoadP(r3, FieldMemOperand(r2, FixedArray::kLengthOffset)); 1011 __ LoadP(r3, FieldMemOperand(r2, FixedArray::kLengthOffset));
1012 __ Push(r3); // Fixed array length (as smi). 1012 __ Push(r3); // Fixed array length (as smi).
1013 PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS); 1013 PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS);
1014 __ LoadSmiLiteral(r2, Smi::kZero); 1014 __ LoadSmiLiteral(r2, Smi::FromInt(0));
1015 __ Push(r2); // Initial index. 1015 __ Push(r2); // Initial index.
1016 1016
1017 // Generate code for doing the condition check. 1017 // Generate code for doing the condition check.
1018 __ bind(&loop); 1018 __ bind(&loop);
1019 SetExpressionAsStatementPosition(stmt->each()); 1019 SetExpressionAsStatementPosition(stmt->each());
1020 1020
1021 // Load the current count to r2, load the length to r3. 1021 // Load the current count to r2, load the length to r3.
1022 __ LoadP(r2, MemOperand(sp, 0 * kPointerSize)); 1022 __ LoadP(r2, MemOperand(sp, 0 * kPointerSize));
1023 __ LoadP(r3, MemOperand(sp, 1 * kPointerSize)); 1023 __ LoadP(r3, MemOperand(sp, 1 * kPointerSize));
1024 __ CmpLogicalP(r2, r3); // Compare to the array length. 1024 __ CmpLogicalP(r2, r3); // Compare to the array length.
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1889 #else 1889 #else
1890 __ LoadRR(right, scratch2); 1890 __ LoadRR(right, scratch2);
1891 #endif 1891 #endif
1892 __ b(&done); 1892 __ b(&done);
1893 // We need -0 if we were multiplying a negative number with 0 to get 0. 1893 // We need -0 if we were multiplying a negative number with 0 to get 0.
1894 // We know one of them was zero. 1894 // We know one of them was zero.
1895 __ bind(&mul_zero); 1895 __ bind(&mul_zero);
1896 __ AddP(scratch2, right, left); 1896 __ AddP(scratch2, right, left);
1897 __ CmpP(scratch2, Operand::Zero()); 1897 __ CmpP(scratch2, Operand::Zero());
1898 __ blt(&stub_call); 1898 __ blt(&stub_call);
1899 __ LoadSmiLiteral(right, Smi::kZero); 1899 __ LoadSmiLiteral(right, Smi::FromInt(0));
1900 break; 1900 break;
1901 } 1901 }
1902 case Token::BIT_OR: 1902 case Token::BIT_OR:
1903 __ OrP(right, left); 1903 __ OrP(right, left);
1904 break; 1904 break;
1905 case Token::BIT_AND: 1905 case Token::BIT_AND:
1906 __ AndP(right, left); 1906 __ AndP(right, left);
1907 break; 1907 break;
1908 case Token::BIT_XOR: 1908 case Token::BIT_XOR:
1909 __ XorP(right, left); 1909 __ XorP(right, left);
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
2988 LhsKind assign_type = Property::GetAssignType(prop); 2988 LhsKind assign_type = Property::GetAssignType(prop);
2989 2989
2990 // Evaluate expression and get value. 2990 // Evaluate expression and get value.
2991 if (assign_type == VARIABLE) { 2991 if (assign_type == VARIABLE) {
2992 DCHECK(expr->expression()->AsVariableProxy()->var() != NULL); 2992 DCHECK(expr->expression()->AsVariableProxy()->var() != NULL);
2993 AccumulatorValueContext context(this); 2993 AccumulatorValueContext context(this);
2994 EmitVariableLoad(expr->expression()->AsVariableProxy()); 2994 EmitVariableLoad(expr->expression()->AsVariableProxy());
2995 } else { 2995 } else {
2996 // Reserve space for result of postfix operation. 2996 // Reserve space for result of postfix operation.
2997 if (expr->is_postfix() && !context()->IsEffect()) { 2997 if (expr->is_postfix() && !context()->IsEffect()) {
2998 __ LoadSmiLiteral(ip, Smi::kZero); 2998 __ LoadSmiLiteral(ip, Smi::FromInt(0));
2999 PushOperand(ip); 2999 PushOperand(ip);
3000 } 3000 }
3001 switch (assign_type) { 3001 switch (assign_type) {
3002 case NAMED_PROPERTY: { 3002 case NAMED_PROPERTY: {
3003 // Put the object both on the stack and in the register. 3003 // Put the object both on the stack and in the register.
3004 VisitForStackValue(prop->obj()); 3004 VisitForStackValue(prop->obj());
3005 __ LoadP(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); 3005 __ LoadP(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0));
3006 EmitNamedPropertyLoad(prop); 3006 EmitNamedPropertyLoad(prop);
3007 break; 3007 break;
3008 } 3008 }
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
3571 DCHECK(kOSRBranchInstruction == br_instr); 3571 DCHECK(kOSRBranchInstruction == br_instr);
3572 3572
3573 DCHECK(interrupt_address == 3573 DCHECK(interrupt_address ==
3574 isolate->builtins()->OnStackReplacement()->entry()); 3574 isolate->builtins()->OnStackReplacement()->entry());
3575 return ON_STACK_REPLACEMENT; 3575 return ON_STACK_REPLACEMENT;
3576 } 3576 }
3577 3577
3578 } // namespace internal 3578 } // namespace internal
3579 } // namespace v8 3579 } // namespace v8
3580 #endif // V8_TARGET_ARCH_S390 3580 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698