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

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

Issue 2682153003: [stubs] Port LoadIndexedStringStub to CSA (Closed)
Patch Set: move to builtins-handler.cc Created 3 years, 10 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/arm/code-stubs-arm.cc ('k') | src/bailout-reason.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 LoadWithVectorDescriptor::SlotRegister())); 1278 LoadWithVectorDescriptor::SlotRegister()));
1279 1279
1280 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, 1280 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10,
1281 x11, &miss); 1281 x11, &miss);
1282 1282
1283 __ Bind(&miss); 1283 __ Bind(&miss);
1284 PropertyAccessCompiler::TailCallBuiltin( 1284 PropertyAccessCompiler::TailCallBuiltin(
1285 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); 1285 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC));
1286 } 1286 }
1287 1287
1288
1289 void LoadIndexedStringStub::Generate(MacroAssembler* masm) {
1290 // Return address is in lr.
1291 Label miss;
1292
1293 Register receiver = LoadDescriptor::ReceiverRegister();
1294 Register index = LoadDescriptor::NameRegister();
1295 Register result = x0;
1296 Register scratch = x10;
1297 DCHECK(!scratch.is(receiver) && !scratch.is(index));
1298 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) &&
1299 result.is(LoadWithVectorDescriptor::SlotRegister()));
1300
1301 // StringCharAtGenerator doesn't use the result register until it's passed
1302 // the different miss possibilities. If it did, we would have a conflict
1303 // when FLAG_vector_ics is true.
1304 StringCharAtGenerator char_at_generator(receiver, index, scratch, result,
1305 &miss, // When not a string.
1306 &miss, // When not a number.
1307 &miss, // When index out of range.
1308 RECEIVER_IS_STRING);
1309 char_at_generator.GenerateFast(masm);
1310 __ Ret();
1311
1312 StubRuntimeCallHelper call_helper;
1313 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper);
1314
1315 __ Bind(&miss);
1316 PropertyAccessCompiler::TailCallBuiltin(
1317 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
1318 }
1319
1320
1321 void RegExpExecStub::Generate(MacroAssembler* masm) { 1288 void RegExpExecStub::Generate(MacroAssembler* masm) {
1322 #ifdef V8_INTERPRETED_REGEXP 1289 #ifdef V8_INTERPRETED_REGEXP
1323 __ TailCallRuntime(Runtime::kRegExpExec); 1290 __ TailCallRuntime(Runtime::kRegExpExec);
1324 #else // V8_INTERPRETED_REGEXP 1291 #else // V8_INTERPRETED_REGEXP
1325 1292
1326 // Stack frame on entry. 1293 // Stack frame on entry.
1327 // jssp[0]: last_match_info (expected JSArray) 1294 // jssp[0]: last_match_info (expected JSArray)
1328 // jssp[8]: previous index 1295 // jssp[8]: previous index
1329 // jssp[16]: subject string 1296 // jssp[16]: subject string
1330 // jssp[24]: JSRegExp object 1297 // jssp[24]: JSRegExp object
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 __ SmiTag(index_); 2016 __ SmiTag(index_);
2050 __ Push(object_, index_); 2017 __ Push(object_, index_);
2051 __ CallRuntime(Runtime::kStringCharCodeAtRT); 2018 __ CallRuntime(Runtime::kStringCharCodeAtRT);
2052 __ Mov(result_, x0); 2019 __ Mov(result_, x0);
2053 call_helper.AfterCall(masm); 2020 call_helper.AfterCall(masm);
2054 __ B(&exit_); 2021 __ B(&exit_);
2055 2022
2056 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); 2023 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase);
2057 } 2024 }
2058 2025
2059
2060 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) {
2061 __ JumpIfNotSmi(code_, &slow_case_);
2062 __ Cmp(code_, Smi::FromInt(String::kMaxOneByteCharCode));
2063 __ B(hi, &slow_case_);
2064
2065 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex);
2066 // At this point code register contains smi tagged one-byte char code.
2067 __ Add(result_, result_, Operand::UntagSmiAndScale(code_, kPointerSizeLog2));
2068 __ Ldr(result_, FieldMemOperand(result_, FixedArray::kHeaderSize));
2069 __ JumpIfRoot(result_, Heap::kUndefinedValueRootIndex, &slow_case_);
2070 __ Bind(&exit_);
2071 }
2072
2073
2074 void StringCharFromCodeGenerator::GenerateSlow(
2075 MacroAssembler* masm,
2076 const RuntimeCallHelper& call_helper) {
2077 __ Abort(kUnexpectedFallthroughToCharFromCodeSlowCase);
2078
2079 __ Bind(&slow_case_);
2080 call_helper.BeforeCall(masm);
2081 __ Push(code_);
2082 __ CallRuntime(Runtime::kStringCharFromCode);
2083 __ Mov(result_, x0);
2084 call_helper.AfterCall(masm);
2085 __ B(&exit_);
2086
2087 __ Abort(kUnexpectedFallthroughFromCharFromCodeSlowCase);
2088 }
2089
2090
2091 void CompareICStub::GenerateBooleans(MacroAssembler* masm) { 2026 void CompareICStub::GenerateBooleans(MacroAssembler* masm) {
2092 // Inputs are in x0 (lhs) and x1 (rhs). 2027 // Inputs are in x0 (lhs) and x1 (rhs).
2093 DCHECK_EQ(CompareICState::BOOLEAN, state()); 2028 DCHECK_EQ(CompareICState::BOOLEAN, state());
2094 ASM_LOCATION("CompareICStub[Booleans]"); 2029 ASM_LOCATION("CompareICStub[Booleans]");
2095 Label miss; 2030 Label miss;
2096 2031
2097 __ CheckMap(x1, x2, Heap::kBooleanMapRootIndex, &miss, DO_SMI_CHECK); 2032 __ CheckMap(x1, x2, Heap::kBooleanMapRootIndex, &miss, DO_SMI_CHECK);
2098 __ CheckMap(x0, x3, Heap::kBooleanMapRootIndex, &miss, DO_SMI_CHECK); 2033 __ CheckMap(x0, x3, Heap::kBooleanMapRootIndex, &miss, DO_SMI_CHECK);
2099 if (!Token::IsEqualityOp(op())) { 2034 if (!Token::IsEqualityOp(op())) {
2100 __ Ldr(x1, FieldMemOperand(x1, Oddball::kToNumberOffset)); 2035 __ Ldr(x1, FieldMemOperand(x1, Oddball::kToNumberOffset));
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
3691 kStackUnwindSpace, NULL, spill_offset, 3626 kStackUnwindSpace, NULL, spill_offset,
3692 return_value_operand, NULL); 3627 return_value_operand, NULL);
3693 } 3628 }
3694 3629
3695 #undef __ 3630 #undef __
3696 3631
3697 } // namespace internal 3632 } // namespace internal
3698 } // namespace v8 3633 } // namespace v8
3699 3634
3700 #endif // V8_TARGET_ARCH_ARM64 3635 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/bailout-reason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698