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

Side by Side Diff: src/s390/code-stubs-s390.cc

Issue 2010183003: [runtime] Kill the %NumberToIntegerMapMinusZero runtime entry. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/runtime/runtime-numbers.cc ('k') | src/x64/code-stubs-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 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 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) && 1384 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) &&
1385 result.is(LoadWithVectorDescriptor::SlotRegister())); 1385 result.is(LoadWithVectorDescriptor::SlotRegister()));
1386 1386
1387 // StringCharAtGenerator doesn't use the result register until it's passed 1387 // StringCharAtGenerator doesn't use the result register until it's passed
1388 // the different miss possibilities. If it did, we would have a conflict 1388 // the different miss possibilities. If it did, we would have a conflict
1389 // when FLAG_vector_ics is true. 1389 // when FLAG_vector_ics is true.
1390 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, 1390 StringCharAtGenerator char_at_generator(receiver, index, scratch, result,
1391 &miss, // When not a string. 1391 &miss, // When not a string.
1392 &miss, // When not a number. 1392 &miss, // When not a number.
1393 &miss, // When index out of range. 1393 &miss, // When index out of range.
1394 STRING_INDEX_IS_ARRAY_INDEX,
1395 RECEIVER_IS_STRING); 1394 RECEIVER_IS_STRING);
1396 char_at_generator.GenerateFast(masm); 1395 char_at_generator.GenerateFast(masm);
1397 __ Ret(); 1396 __ Ret();
1398 1397
1399 StubRuntimeCallHelper call_helper; 1398 StubRuntimeCallHelper call_helper;
1400 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); 1399 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper);
1401 1400
1402 __ bind(&miss); 1401 __ bind(&miss);
1403 PropertyAccessCompiler::TailCallBuiltin( 1402 PropertyAccessCompiler::TailCallBuiltin(
1404 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); 1403 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2216 __ CheckMap(index_, result_, Heap::kHeapNumberMapRootIndex, index_not_number_, 2215 __ CheckMap(index_, result_, Heap::kHeapNumberMapRootIndex, index_not_number_,
2217 DONT_DO_SMI_CHECK); 2216 DONT_DO_SMI_CHECK);
2218 call_helper.BeforeCall(masm); 2217 call_helper.BeforeCall(masm);
2219 if (embed_mode == PART_OF_IC_HANDLER) { 2218 if (embed_mode == PART_OF_IC_HANDLER) {
2220 __ Push(LoadWithVectorDescriptor::VectorRegister(), 2219 __ Push(LoadWithVectorDescriptor::VectorRegister(),
2221 LoadWithVectorDescriptor::SlotRegister(), object_, index_); 2220 LoadWithVectorDescriptor::SlotRegister(), object_, index_);
2222 } else { 2221 } else {
2223 // index_ is consumed by runtime conversion function. 2222 // index_ is consumed by runtime conversion function.
2224 __ Push(object_, index_); 2223 __ Push(object_, index_);
2225 } 2224 }
2226 if (index_flags_ == STRING_INDEX_IS_NUMBER) { 2225 __ CallRuntime(Runtime::kNumberToSmi);
2227 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero);
2228 } else {
2229 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX);
2230 // NumberToSmi discards numbers that are not exact integers.
2231 __ CallRuntime(Runtime::kNumberToSmi);
2232 }
2233 // Save the conversion result before the pop instructions below 2226 // Save the conversion result before the pop instructions below
2234 // have a chance to overwrite it. 2227 // have a chance to overwrite it.
2235 __ Move(index_, r2); 2228 __ Move(index_, r2);
2236 if (embed_mode == PART_OF_IC_HANDLER) { 2229 if (embed_mode == PART_OF_IC_HANDLER) {
2237 __ Pop(LoadWithVectorDescriptor::VectorRegister(), 2230 __ Pop(LoadWithVectorDescriptor::VectorRegister(),
2238 LoadWithVectorDescriptor::SlotRegister(), object_); 2231 LoadWithVectorDescriptor::SlotRegister(), object_);
2239 } else { 2232 } else {
2240 __ pop(object_); 2233 __ pop(object_);
2241 } 2234 }
2242 // Reload the instance type. 2235 // Reload the instance type.
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 __ bind(&runtime); 2546 __ bind(&runtime);
2554 __ TailCallRuntime(Runtime::kSubString); 2547 __ TailCallRuntime(Runtime::kSubString);
2555 2548
2556 __ bind(&single_char); 2549 __ bind(&single_char);
2557 // r2: original string 2550 // r2: original string
2558 // r3: instance type 2551 // r3: instance type
2559 // r4: length 2552 // r4: length
2560 // r5: from index (untagged) 2553 // r5: from index (untagged)
2561 __ SmiTag(r5, r5); 2554 __ SmiTag(r5, r5);
2562 StringCharAtGenerator generator(r2, r5, r4, r2, &runtime, &runtime, &runtime, 2555 StringCharAtGenerator generator(r2, r5, r4, r2, &runtime, &runtime, &runtime,
2563 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); 2556 RECEIVER_IS_STRING);
2564 generator.GenerateFast(masm); 2557 generator.GenerateFast(masm);
2565 __ Drop(3); 2558 __ Drop(3);
2566 __ Ret(); 2559 __ Ret();
2567 generator.SkipSlow(masm, &runtime); 2560 generator.SkipSlow(masm, &runtime);
2568 } 2561 }
2569 2562
2570 void ToNumberStub::Generate(MacroAssembler* masm) { 2563 void ToNumberStub::Generate(MacroAssembler* masm) {
2571 // The ToNumber stub takes one argument in r2. 2564 // The ToNumber stub takes one argument in r2.
2572 STATIC_ASSERT(kSmiTag == 0); 2565 STATIC_ASSERT(kSmiTag == 0);
2573 __ TestIfSmi(r2); 2566 __ TestIfSmi(r2);
(...skipping 3033 matching lines...) Expand 10 before | Expand all | Expand 10 after
5607 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5600 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5608 kStackUnwindSpace, NULL, return_value_operand, NULL); 5601 kStackUnwindSpace, NULL, return_value_operand, NULL);
5609 } 5602 }
5610 5603
5611 #undef __ 5604 #undef __
5612 5605
5613 } // namespace internal 5606 } // namespace internal
5614 } // namespace v8 5607 } // namespace v8
5615 5608
5616 #endif // V8_TARGET_ARCH_S390 5609 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/runtime/runtime-numbers.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698