| OLD | NEW |
| 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // NOTICE! This code is only reached after a smi-fast-case check, so | 546 // NOTICE! This code is only reached after a smi-fast-case check, so |
| 547 // it is certain that at least one operand isn't a smi. | 547 // it is certain that at least one operand isn't a smi. |
| 548 | 548 |
| 549 // Handle the case where the objects are identical. Either returns the answer | 549 // Handle the case where the objects are identical. Either returns the answer |
| 550 // or goes to slow. Only falls through if the objects were not identical. | 550 // or goes to slow. Only falls through if the objects were not identical. |
| 551 EmitIdenticalObjectComparison(masm, &slow, cc); | 551 EmitIdenticalObjectComparison(masm, &slow, cc); |
| 552 | 552 |
| 553 // If either is a Smi (we know that not both are), then they can only | 553 // If either is a Smi (we know that not both are), then they can only |
| 554 // be strictly equal if the other is a HeapNumber. | 554 // be strictly equal if the other is a HeapNumber. |
| 555 STATIC_ASSERT(kSmiTag == 0); | 555 STATIC_ASSERT(kSmiTag == 0); |
| 556 DCHECK_EQ(static_cast<Smi*>(0), Smi::kZero); | 556 DCHECK_EQ(static_cast<Smi*>(0), Smi::FromInt(0)); |
| 557 __ AndP(r4, lhs, rhs); | 557 __ AndP(r4, lhs, rhs); |
| 558 __ JumpIfNotSmi(r4, ¬_smis); | 558 __ JumpIfNotSmi(r4, ¬_smis); |
| 559 // One operand is a smi. EmitSmiNonsmiComparison generates code that can: | 559 // One operand is a smi. EmitSmiNonsmiComparison generates code that can: |
| 560 // 1) Return the answer. | 560 // 1) Return the answer. |
| 561 // 2) Go to slow. | 561 // 2) Go to slow. |
| 562 // 3) Fall through to both_loaded_as_doubles. | 562 // 3) Fall through to both_loaded_as_doubles. |
| 563 // 4) Jump to lhs_not_nan. | 563 // 4) Jump to lhs_not_nan. |
| 564 // In cases 3 and 4 we have found out we were dealing with a number-number | 564 // In cases 3 and 4 we have found out we were dealing with a number-number |
| 565 // comparison. The double values of the numbers have been loaded | 565 // comparison. The double values of the numbers have been loaded |
| 566 // into d7 and d6. | 566 // into d7 and d6. |
| (...skipping 3741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4308 __ LoadRR(r8, r7); | 4308 __ LoadRR(r8, r7); |
| 4309 __ bind(&skip); | 4309 __ bind(&skip); |
| 4310 | 4310 |
| 4311 __ bind(&try_allocate); | 4311 __ bind(&try_allocate); |
| 4312 | 4312 |
| 4313 // Compute the sizes of backing store, parameter map, and arguments object. | 4313 // Compute the sizes of backing store, parameter map, and arguments object. |
| 4314 // 1. Parameter map, has 2 extra words containing context and backing store. | 4314 // 1. Parameter map, has 2 extra words containing context and backing store. |
| 4315 const int kParameterMapHeaderSize = | 4315 const int kParameterMapHeaderSize = |
| 4316 FixedArray::kHeaderSize + 2 * kPointerSize; | 4316 FixedArray::kHeaderSize + 2 * kPointerSize; |
| 4317 // If there are no mapped parameters, we do not need the parameter_map. | 4317 // If there are no mapped parameters, we do not need the parameter_map. |
| 4318 __ CmpSmiLiteral(r8, Smi::kZero, r0); | 4318 __ CmpSmiLiteral(r8, Smi::FromInt(0), r0); |
| 4319 Label skip2, skip3; | 4319 Label skip2, skip3; |
| 4320 __ bne(&skip2); | 4320 __ bne(&skip2); |
| 4321 __ LoadImmP(r1, Operand::Zero()); | 4321 __ LoadImmP(r1, Operand::Zero()); |
| 4322 __ b(&skip3); | 4322 __ b(&skip3); |
| 4323 __ bind(&skip2); | 4323 __ bind(&skip2); |
| 4324 __ SmiToPtrArrayOffset(r1, r8); | 4324 __ SmiToPtrArrayOffset(r1, r8); |
| 4325 __ AddP(r1, r1, Operand(kParameterMapHeaderSize)); | 4325 __ AddP(r1, r1, Operand(kParameterMapHeaderSize)); |
| 4326 __ bind(&skip3); | 4326 __ bind(&skip3); |
| 4327 | 4327 |
| 4328 // 2. Backing store. | 4328 // 2. Backing store. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4378 // it will point to the backing store. | 4378 // it will point to the backing store. |
| 4379 __ AddP(r6, r2, Operand(JSSloppyArgumentsObject::kSize)); | 4379 __ AddP(r6, r2, Operand(JSSloppyArgumentsObject::kSize)); |
| 4380 __ StoreP(r6, FieldMemOperand(r2, JSObject::kElementsOffset), r0); | 4380 __ StoreP(r6, FieldMemOperand(r2, JSObject::kElementsOffset), r0); |
| 4381 | 4381 |
| 4382 // r2 = address of new object (tagged) | 4382 // r2 = address of new object (tagged) |
| 4383 // r4 = argument count (tagged) | 4383 // r4 = argument count (tagged) |
| 4384 // r6 = address of parameter map or backing store (tagged) | 4384 // r6 = address of parameter map or backing store (tagged) |
| 4385 // r8 = mapped parameter count (tagged) | 4385 // r8 = mapped parameter count (tagged) |
| 4386 // Initialize parameter map. If there are no mapped arguments, we're done. | 4386 // Initialize parameter map. If there are no mapped arguments, we're done. |
| 4387 Label skip_parameter_map; | 4387 Label skip_parameter_map; |
| 4388 __ CmpSmiLiteral(r8, Smi::kZero, r0); | 4388 __ CmpSmiLiteral(r8, Smi::FromInt(0), r0); |
| 4389 Label skip6; | 4389 Label skip6; |
| 4390 __ bne(&skip6); | 4390 __ bne(&skip6); |
| 4391 // Move backing store address to r3, because it is | 4391 // Move backing store address to r3, because it is |
| 4392 // expected there when filling in the unmapped arguments. | 4392 // expected there when filling in the unmapped arguments. |
| 4393 __ LoadRR(r3, r6); | 4393 __ LoadRR(r3, r6); |
| 4394 __ b(&skip_parameter_map); | 4394 __ b(&skip_parameter_map); |
| 4395 __ bind(&skip6); | 4395 __ bind(&skip6); |
| 4396 | 4396 |
| 4397 __ LoadRoot(r7, Heap::kSloppyArgumentsElementsMapRootIndex); | 4397 __ LoadRoot(r7, Heap::kSloppyArgumentsElementsMapRootIndex); |
| 4398 __ StoreP(r7, FieldMemOperand(r6, FixedArray::kMapOffset), r0); | 4398 __ StoreP(r7, FieldMemOperand(r6, FixedArray::kMapOffset), r0); |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5015 Register api_function_address = r4; | 5015 Register api_function_address = r4; |
| 5016 | 5016 |
| 5017 __ push(receiver); | 5017 __ push(receiver); |
| 5018 // Push data from AccessorInfo. | 5018 // Push data from AccessorInfo. |
| 5019 __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset)); | 5019 __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset)); |
| 5020 __ push(scratch); | 5020 __ push(scratch); |
| 5021 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5021 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
| 5022 __ Push(scratch, scratch); | 5022 __ Push(scratch, scratch); |
| 5023 __ mov(scratch, Operand(ExternalReference::isolate_address(isolate()))); | 5023 __ mov(scratch, Operand(ExternalReference::isolate_address(isolate()))); |
| 5024 __ Push(scratch, holder); | 5024 __ Push(scratch, holder); |
| 5025 __ Push(Smi::kZero); // should_throw_on_error -> false | 5025 __ Push(Smi::FromInt(0)); // should_throw_on_error -> false |
| 5026 __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset)); | 5026 __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset)); |
| 5027 __ push(scratch); | 5027 __ push(scratch); |
| 5028 | 5028 |
| 5029 // v8::PropertyCallbackInfo::args_ array and name handle. | 5029 // v8::PropertyCallbackInfo::args_ array and name handle. |
| 5030 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; | 5030 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
| 5031 | 5031 |
| 5032 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. | 5032 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. |
| 5033 __ LoadRR(r2, sp); // r2 = Handle<Name> | 5033 __ LoadRR(r2, sp); // r2 = Handle<Name> |
| 5034 __ AddP(r3, r2, Operand(1 * kPointerSize)); // r3 = v8::PCI::args_ | 5034 __ AddP(r3, r2, Operand(1 * kPointerSize)); // r3 = v8::PCI::args_ |
| 5035 | 5035 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5082 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5082 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5083 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5083 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5084 } | 5084 } |
| 5085 | 5085 |
| 5086 #undef __ | 5086 #undef __ |
| 5087 | 5087 |
| 5088 } // namespace internal | 5088 } // namespace internal |
| 5089 } // namespace v8 | 5089 } // namespace v8 |
| 5090 | 5090 |
| 5091 #endif // V8_TARGET_ARCH_S390 | 5091 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |