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

Side by Side Diff: src/ppc/code-stubs-ppc.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/objects-inl.h ('k') | src/ppc/macro-assembler-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 // NOTICE! This code is only reached after a smi-fast-case check, so 554 // NOTICE! This code is only reached after a smi-fast-case check, so
555 // it is certain that at least one operand isn't a smi. 555 // it is certain that at least one operand isn't a smi.
556 556
557 // Handle the case where the objects are identical. Either returns the answer 557 // Handle the case where the objects are identical. Either returns the answer
558 // or goes to slow. Only falls through if the objects were not identical. 558 // or goes to slow. Only falls through if the objects were not identical.
559 EmitIdenticalObjectComparison(masm, &slow, cc); 559 EmitIdenticalObjectComparison(masm, &slow, cc);
560 560
561 // If either is a Smi (we know that not both are), then they can only 561 // If either is a Smi (we know that not both are), then they can only
562 // be strictly equal if the other is a HeapNumber. 562 // be strictly equal if the other is a HeapNumber.
563 STATIC_ASSERT(kSmiTag == 0); 563 STATIC_ASSERT(kSmiTag == 0);
564 DCHECK_EQ(static_cast<Smi*>(0), Smi::kZero); 564 DCHECK_EQ(static_cast<Smi*>(0), Smi::FromInt(0));
565 __ and_(r5, lhs, rhs); 565 __ and_(r5, lhs, rhs);
566 __ JumpIfNotSmi(r5, &not_smis); 566 __ JumpIfNotSmi(r5, &not_smis);
567 // One operand is a smi. EmitSmiNonsmiComparison generates code that can: 567 // One operand is a smi. EmitSmiNonsmiComparison generates code that can:
568 // 1) Return the answer. 568 // 1) Return the answer.
569 // 2) Go to slow. 569 // 2) Go to slow.
570 // 3) Fall through to both_loaded_as_doubles. 570 // 3) Fall through to both_loaded_as_doubles.
571 // 4) Jump to lhs_not_nan. 571 // 4) Jump to lhs_not_nan.
572 // In cases 3 and 4 we have found out we were dealing with a number-number 572 // In cases 3 and 4 we have found out we were dealing with a number-number
573 // comparison. The double values of the numbers have been loaded 573 // comparison. The double values of the numbers have been loaded
574 // into d7 and d6. 574 // into d7 and d6.
(...skipping 3803 matching lines...) Expand 10 before | Expand all | Expand 10 after
4378 __ bind(&skip); 4378 __ bind(&skip);
4379 } 4379 }
4380 4380
4381 __ bind(&try_allocate); 4381 __ bind(&try_allocate);
4382 4382
4383 // Compute the sizes of backing store, parameter map, and arguments object. 4383 // Compute the sizes of backing store, parameter map, and arguments object.
4384 // 1. Parameter map, has 2 extra words containing context and backing store. 4384 // 1. Parameter map, has 2 extra words containing context and backing store.
4385 const int kParameterMapHeaderSize = 4385 const int kParameterMapHeaderSize =
4386 FixedArray::kHeaderSize + 2 * kPointerSize; 4386 FixedArray::kHeaderSize + 2 * kPointerSize;
4387 // If there are no mapped parameters, we do not need the parameter_map. 4387 // If there are no mapped parameters, we do not need the parameter_map.
4388 __ CmpSmiLiteral(r9, Smi::kZero, r0); 4388 __ CmpSmiLiteral(r9, Smi::FromInt(0), r0);
4389 if (CpuFeatures::IsSupported(ISELECT)) { 4389 if (CpuFeatures::IsSupported(ISELECT)) {
4390 __ SmiToPtrArrayOffset(r11, r9); 4390 __ SmiToPtrArrayOffset(r11, r9);
4391 __ addi(r11, r11, Operand(kParameterMapHeaderSize)); 4391 __ addi(r11, r11, Operand(kParameterMapHeaderSize));
4392 __ isel(eq, r11, r0, r11); 4392 __ isel(eq, r11, r0, r11);
4393 } else { 4393 } else {
4394 Label skip2, skip3; 4394 Label skip2, skip3;
4395 __ bne(&skip2); 4395 __ bne(&skip2);
4396 __ li(r11, Operand::Zero()); 4396 __ li(r11, Operand::Zero());
4397 __ b(&skip3); 4397 __ b(&skip3);
4398 __ bind(&skip2); 4398 __ bind(&skip2);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
4460 // it will point to the backing store. 4460 // it will point to the backing store.
4461 __ addi(r7, r3, Operand(JSSloppyArgumentsObject::kSize)); 4461 __ addi(r7, r3, Operand(JSSloppyArgumentsObject::kSize));
4462 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0); 4462 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0);
4463 4463
4464 // r3 = address of new object (tagged) 4464 // r3 = address of new object (tagged)
4465 // r5 = argument count (tagged) 4465 // r5 = argument count (tagged)
4466 // r7 = address of parameter map or backing store (tagged) 4466 // r7 = address of parameter map or backing store (tagged)
4467 // r9 = mapped parameter count (tagged) 4467 // r9 = mapped parameter count (tagged)
4468 // Initialize parameter map. If there are no mapped arguments, we're done. 4468 // Initialize parameter map. If there are no mapped arguments, we're done.
4469 Label skip_parameter_map; 4469 Label skip_parameter_map;
4470 __ CmpSmiLiteral(r9, Smi::kZero, r0); 4470 __ CmpSmiLiteral(r9, Smi::FromInt(0), r0);
4471 if (CpuFeatures::IsSupported(ISELECT)) { 4471 if (CpuFeatures::IsSupported(ISELECT)) {
4472 __ isel(eq, r4, r7, r4); 4472 __ isel(eq, r4, r7, r4);
4473 __ beq(&skip_parameter_map); 4473 __ beq(&skip_parameter_map);
4474 } else { 4474 } else {
4475 Label skip6; 4475 Label skip6;
4476 __ bne(&skip6); 4476 __ bne(&skip6);
4477 // Move backing store address to r4, because it is 4477 // Move backing store address to r4, because it is
4478 // expected there when filling in the unmapped arguments. 4478 // expected there when filling in the unmapped arguments.
4479 __ mr(r4, r7); 4479 __ mr(r4, r7);
4480 __ b(&skip_parameter_map); 4480 __ b(&skip_parameter_map);
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
5106 Register api_function_address = r5; 5106 Register api_function_address = r5;
5107 5107
5108 __ push(receiver); 5108 __ push(receiver);
5109 // Push data from AccessorInfo. 5109 // Push data from AccessorInfo.
5110 __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset)); 5110 __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));
5111 __ push(scratch); 5111 __ push(scratch);
5112 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); 5112 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
5113 __ Push(scratch, scratch); 5113 __ Push(scratch, scratch);
5114 __ mov(scratch, Operand(ExternalReference::isolate_address(isolate()))); 5114 __ mov(scratch, Operand(ExternalReference::isolate_address(isolate())));
5115 __ Push(scratch, holder); 5115 __ Push(scratch, holder);
5116 __ Push(Smi::kZero); // should_throw_on_error -> false 5116 __ Push(Smi::FromInt(0)); // should_throw_on_error -> false
5117 __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset)); 5117 __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
5118 __ push(scratch); 5118 __ push(scratch);
5119 5119
5120 // v8::PropertyCallbackInfo::args_ array and name handle. 5120 // v8::PropertyCallbackInfo::args_ array and name handle.
5121 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; 5121 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
5122 5122
5123 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. 5123 // Load address of v8::PropertyAccessorInfo::args_ array and name handle.
5124 __ mr(r3, sp); // r3 = Handle<Name> 5124 __ mr(r3, sp); // r3 = Handle<Name>
5125 __ addi(r4, r3, Operand(1 * kPointerSize)); // r4 = v8::PCI::args_ 5125 __ addi(r4, r3, Operand(1 * kPointerSize)); // r4 = v8::PCI::args_
5126 5126
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
5172 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); 5172 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
5173 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5173 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5174 kStackUnwindSpace, NULL, return_value_operand, NULL); 5174 kStackUnwindSpace, NULL, return_value_operand, NULL);
5175 } 5175 }
5176 5176
5177 #undef __ 5177 #undef __
5178 } // namespace internal 5178 } // namespace internal
5179 } // namespace v8 5179 } // namespace v8
5180 5180
5181 #endif // V8_TARGET_ARCH_PPC 5181 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/ppc/macro-assembler-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698