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 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 DCHECK(!AreAliased(r6, r7, LoadWithVectorDescriptor::VectorRegister(), | 1227 DCHECK(!AreAliased(r6, r7, LoadWithVectorDescriptor::VectorRegister(), |
1228 LoadWithVectorDescriptor::SlotRegister())); | 1228 LoadWithVectorDescriptor::SlotRegister())); |
1229 | 1229 |
1230 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r6, | 1230 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r6, |
1231 r7, &miss); | 1231 r7, &miss); |
1232 __ bind(&miss); | 1232 __ bind(&miss); |
1233 PropertyAccessCompiler::TailCallBuiltin( | 1233 PropertyAccessCompiler::TailCallBuiltin( |
1234 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 1234 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
1235 } | 1235 } |
1236 | 1236 |
1237 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { | |
1238 // Return address is in lr. | |
1239 Label miss; | |
1240 | |
1241 Register receiver = LoadDescriptor::ReceiverRegister(); | |
1242 Register index = LoadDescriptor::NameRegister(); | |
1243 Register scratch = r7; | |
1244 Register result = r2; | |
1245 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | |
1246 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) && | |
1247 result.is(LoadWithVectorDescriptor::SlotRegister())); | |
1248 | |
1249 // StringCharAtGenerator doesn't use the result register until it's passed | |
1250 // the different miss possibilities. If it did, we would have a conflict | |
1251 // when FLAG_vector_ics is true. | |
1252 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | |
1253 &miss, // When not a string. | |
1254 &miss, // When not a number. | |
1255 &miss, // When index out of range. | |
1256 RECEIVER_IS_STRING); | |
1257 char_at_generator.GenerateFast(masm); | |
1258 __ Ret(); | |
1259 | |
1260 StubRuntimeCallHelper call_helper; | |
1261 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); | |
1262 | |
1263 __ bind(&miss); | |
1264 PropertyAccessCompiler::TailCallBuiltin( | |
1265 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | |
1266 } | |
1267 | |
1268 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1237 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1269 // Just jump directly to runtime if native RegExp is not selected at compile | 1238 // Just jump directly to runtime if native RegExp is not selected at compile |
1270 // time or if regexp entry in generated code is turned off runtime switch or | 1239 // time or if regexp entry in generated code is turned off runtime switch or |
1271 // at compilation. | 1240 // at compilation. |
1272 #ifdef V8_INTERPRETED_REGEXP | 1241 #ifdef V8_INTERPRETED_REGEXP |
1273 __ TailCallRuntime(Runtime::kRegExpExec); | 1242 __ TailCallRuntime(Runtime::kRegExpExec); |
1274 #else // V8_INTERPRETED_REGEXP | 1243 #else // V8_INTERPRETED_REGEXP |
1275 | 1244 |
1276 // Stack frame on entry. | 1245 // Stack frame on entry. |
1277 // sp[0]: last_match_info (expected JSArray) | 1246 // sp[0]: last_match_info (expected JSArray) |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 __ SmiTag(index_); | 1907 __ SmiTag(index_); |
1939 __ Push(object_, index_); | 1908 __ Push(object_, index_); |
1940 __ CallRuntime(Runtime::kStringCharCodeAtRT); | 1909 __ CallRuntime(Runtime::kStringCharCodeAtRT); |
1941 __ Move(result_, r2); | 1910 __ Move(result_, r2); |
1942 call_helper.AfterCall(masm); | 1911 call_helper.AfterCall(masm); |
1943 __ b(&exit_); | 1912 __ b(&exit_); |
1944 | 1913 |
1945 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); | 1914 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); |
1946 } | 1915 } |
1947 | 1916 |
1948 // ------------------------------------------------------------------------- | |
1949 // StringCharFromCodeGenerator | |
1950 | |
1951 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | |
1952 // Fast case of Heap::LookupSingleCharacterStringFromCode. | |
1953 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCodeU + 1)); | |
1954 __ LoadSmiLiteral(r0, Smi::FromInt(~String::kMaxOneByteCharCodeU)); | |
1955 __ OrP(r0, r0, Operand(kSmiTagMask)); | |
1956 __ AndP(r0, code_, r0); | |
1957 __ bne(&slow_case_); | |
1958 | |
1959 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); | |
1960 // At this point code register contains smi tagged one-byte char code. | |
1961 __ LoadRR(r0, code_); | |
1962 __ SmiToPtrArrayOffset(code_, code_); | |
1963 __ AddP(result_, code_); | |
1964 __ LoadRR(code_, r0); | |
1965 __ LoadP(result_, FieldMemOperand(result_, FixedArray::kHeaderSize)); | |
1966 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); | |
1967 __ beq(&slow_case_); | |
1968 __ bind(&exit_); | |
1969 } | |
1970 | |
1971 void StringCharFromCodeGenerator::GenerateSlow( | |
1972 MacroAssembler* masm, const RuntimeCallHelper& call_helper) { | |
1973 __ Abort(kUnexpectedFallthroughToCharFromCodeSlowCase); | |
1974 | |
1975 __ bind(&slow_case_); | |
1976 call_helper.BeforeCall(masm); | |
1977 __ push(code_); | |
1978 __ CallRuntime(Runtime::kStringCharFromCode); | |
1979 __ Move(result_, r2); | |
1980 call_helper.AfterCall(masm); | |
1981 __ b(&exit_); | |
1982 | |
1983 __ Abort(kUnexpectedFallthroughFromCharFromCodeSlowCase); | |
1984 } | |
1985 | |
1986 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 1917 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
1987 Register left, | 1918 Register left, |
1988 Register right, | 1919 Register right, |
1989 Register scratch1, | 1920 Register scratch1, |
1990 Register scratch2) { | 1921 Register scratch2) { |
1991 Register length = scratch1; | 1922 Register length = scratch1; |
1992 | 1923 |
1993 // Compare lengths. | 1924 // Compare lengths. |
1994 Label strings_not_equal, check_zero_length; | 1925 Label strings_not_equal, check_zero_length; |
1995 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset)); | 1926 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset)); |
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3562 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 3493 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
3563 kStackUnwindSpace, NULL, return_value_operand, NULL); | 3494 kStackUnwindSpace, NULL, return_value_operand, NULL); |
3564 } | 3495 } |
3565 | 3496 |
3566 #undef __ | 3497 #undef __ |
3567 | 3498 |
3568 } // namespace internal | 3499 } // namespace internal |
3569 } // namespace v8 | 3500 } // namespace v8 |
3570 | 3501 |
3571 #endif // V8_TARGET_ARCH_S390 | 3502 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |