| 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 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 __ TailCallExternalReference( | 1865 __ TailCallExternalReference( |
| 1866 ExternalReference(Builtins::c_ArrayPop, isolate()), argc + 1, 1); | 1866 ExternalReference(Builtins::c_ArrayPop, isolate()), argc + 1, 1); |
| 1867 | 1867 |
| 1868 HandlerFrontendFooter(&miss); | 1868 HandlerFrontendFooter(&miss); |
| 1869 | 1869 |
| 1870 // Return the generated code. | 1870 // Return the generated code. |
| 1871 return GetCode(type, name); | 1871 return GetCode(type, name); |
| 1872 } | 1872 } |
| 1873 | 1873 |
| 1874 | 1874 |
| 1875 Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall( | |
| 1876 Handle<Object> object, | |
| 1877 Handle<JSObject> holder, | |
| 1878 Handle<Cell> cell, | |
| 1879 Handle<JSFunction> function, | |
| 1880 Handle<String> name, | |
| 1881 Code::StubType type) { | |
| 1882 const int argc = arguments().immediate(); | |
| 1883 | |
| 1884 // If the object is not a JSObject or we got an unexpected number of | |
| 1885 // arguments, bail out to the regular call. | |
| 1886 if (!object->IsJSObject() || argc != 1) return Handle<Code>::null(); | |
| 1887 | |
| 1888 Label miss; | |
| 1889 HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); | |
| 1890 if (!cell.is_null()) { | |
| 1891 ASSERT(cell->value() == *function); | |
| 1892 GenerateLoadFunctionFromCell(cell, function, &miss); | |
| 1893 } | |
| 1894 | |
| 1895 // Load the char code argument. | |
| 1896 Register code = a1; | |
| 1897 __ lw(code, MemOperand(sp, 0 * kPointerSize)); | |
| 1898 | |
| 1899 // Check the code is a smi. | |
| 1900 Label slow; | |
| 1901 STATIC_ASSERT(kSmiTag == 0); | |
| 1902 __ JumpIfNotSmi(code, &slow); | |
| 1903 | |
| 1904 // Convert the smi code to uint16. | |
| 1905 __ And(code, code, Operand(Smi::FromInt(0xffff))); | |
| 1906 | |
| 1907 StringCharFromCodeGenerator generator(code, v0); | |
| 1908 generator.GenerateFast(masm()); | |
| 1909 __ DropAndRet(argc + 1); | |
| 1910 | |
| 1911 StubRuntimeCallHelper call_helper; | |
| 1912 generator.GenerateSlow(masm(), call_helper); | |
| 1913 | |
| 1914 __ bind(&slow); | |
| 1915 // We do not have to patch the receiver because the function makes no use of | |
| 1916 // it. | |
| 1917 GenerateJumpFunctionIgnoreReceiver(function); | |
| 1918 | |
| 1919 HandlerFrontendFooter(&miss); | |
| 1920 | |
| 1921 // Return the generated code. | |
| 1922 return GetCode(type, name); | |
| 1923 } | |
| 1924 | |
| 1925 | |
| 1926 Handle<Code> CallStubCompiler::CompileFastApiCall( | 1875 Handle<Code> CallStubCompiler::CompileFastApiCall( |
| 1927 const CallOptimization& optimization, | 1876 const CallOptimization& optimization, |
| 1928 Handle<Object> object, | 1877 Handle<Object> object, |
| 1929 Handle<JSObject> holder, | 1878 Handle<JSObject> holder, |
| 1930 Handle<Cell> cell, | 1879 Handle<Cell> cell, |
| 1931 Handle<JSFunction> function, | 1880 Handle<JSFunction> function, |
| 1932 Handle<String> name) { | 1881 Handle<String> name) { |
| 1933 | 1882 |
| 1934 Counters* counters = isolate()->counters(); | 1883 Counters* counters = isolate()->counters(); |
| 1935 | 1884 |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2535 // ----------------------------------- | 2484 // ----------------------------------- |
| 2536 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2485 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 2537 } | 2486 } |
| 2538 | 2487 |
| 2539 | 2488 |
| 2540 #undef __ | 2489 #undef __ |
| 2541 | 2490 |
| 2542 } } // namespace v8::internal | 2491 } } // namespace v8::internal |
| 2543 | 2492 |
| 2544 #endif // V8_TARGET_ARCH_MIPS | 2493 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |