OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 __ TailCallExternalReference( | 1882 __ TailCallExternalReference( |
1883 ExternalReference(Builtins::c_ArrayPop, isolate()), argc + 1, 1); | 1883 ExternalReference(Builtins::c_ArrayPop, isolate()), argc + 1, 1); |
1884 | 1884 |
1885 HandlerFrontendFooter(&miss); | 1885 HandlerFrontendFooter(&miss); |
1886 | 1886 |
1887 // Return the generated code. | 1887 // Return the generated code. |
1888 return GetCode(type, name); | 1888 return GetCode(type, name); |
1889 } | 1889 } |
1890 | 1890 |
1891 | 1891 |
1892 Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall( | |
1893 Handle<Object> object, | |
1894 Handle<JSObject> holder, | |
1895 Handle<Cell> cell, | |
1896 Handle<JSFunction> function, | |
1897 Handle<String> name, | |
1898 Code::StubType type) { | |
1899 const int argc = arguments().immediate(); | |
1900 | |
1901 // If the object is not a JSObject or we got an unexpected number of | |
1902 // arguments, bail out to the regular call. | |
1903 if (!object->IsJSObject() || argc != 1) return Handle<Code>::null(); | |
1904 | |
1905 Label miss; | |
1906 | |
1907 HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); | |
1908 if (!cell.is_null()) { | |
1909 ASSERT(cell->value() == *function); | |
1910 GenerateLoadFunctionFromCell(cell, function, &miss); | |
1911 } | |
1912 | |
1913 // Load the char code argument. | |
1914 Register code = r1; | |
1915 __ ldr(code, MemOperand(sp, 0 * kPointerSize)); | |
1916 | |
1917 // Check the code is a smi. | |
1918 Label slow; | |
1919 __ JumpIfNotSmi(code, &slow); | |
1920 | |
1921 // Convert the smi code to uint16. | |
1922 __ and_(code, code, Operand(Smi::FromInt(0xffff))); | |
1923 | |
1924 StringCharFromCodeGenerator generator(code, r0); | |
1925 generator.GenerateFast(masm()); | |
1926 __ Drop(argc + 1); | |
1927 __ Ret(); | |
1928 | |
1929 StubRuntimeCallHelper call_helper; | |
1930 generator.GenerateSlow(masm(), call_helper); | |
1931 | |
1932 __ bind(&slow); | |
1933 // We do not have to patch the receiver because the function makes no use of | |
1934 // it. | |
1935 GenerateJumpFunctionIgnoreReceiver(function); | |
1936 | |
1937 HandlerFrontendFooter(&miss); | |
1938 | |
1939 // Return the generated code. | |
1940 return GetCode(type, name); | |
1941 } | |
1942 | |
1943 | |
1944 Handle<Code> CallStubCompiler::CompileFastApiCall( | 1892 Handle<Code> CallStubCompiler::CompileFastApiCall( |
1945 const CallOptimization& optimization, | 1893 const CallOptimization& optimization, |
1946 Handle<Object> object, | 1894 Handle<Object> object, |
1947 Handle<JSObject> holder, | 1895 Handle<JSObject> holder, |
1948 Handle<Cell> cell, | 1896 Handle<Cell> cell, |
1949 Handle<JSFunction> function, | 1897 Handle<JSFunction> function, |
1950 Handle<String> name) { | 1898 Handle<String> name) { |
1951 Counters* counters = isolate()->counters(); | 1899 Counters* counters = isolate()->counters(); |
1952 | 1900 |
1953 ASSERT(optimization.is_simple_api_call()); | 1901 ASSERT(optimization.is_simple_api_call()); |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2555 // ----------------------------------- | 2503 // ----------------------------------- |
2556 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2504 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
2557 } | 2505 } |
2558 | 2506 |
2559 | 2507 |
2560 #undef __ | 2508 #undef __ |
2561 | 2509 |
2562 } } // namespace v8::internal | 2510 } } // namespace v8::internal |
2563 | 2511 |
2564 #endif // V8_TARGET_ARCH_ARM | 2512 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |