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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 | 1100 |
1101 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { | 1101 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { |
1102 __ Jump(code, RelocInfo::CODE_TARGET); | 1102 __ Jump(code, RelocInfo::CODE_TARGET); |
1103 } | 1103 } |
1104 | 1104 |
1105 | 1105 |
1106 #undef __ | 1106 #undef __ |
1107 #define __ ACCESS_MASM(masm()) | 1107 #define __ ACCESS_MASM(masm()) |
1108 | 1108 |
1109 | 1109 |
1110 Register StubCompiler::CheckPrototypes(Handle<Type> type, | 1110 Register StubCompiler::CheckPrototypes(Handle<HeapType> type, |
1111 Register object_reg, | 1111 Register object_reg, |
1112 Handle<JSObject> holder, | 1112 Handle<JSObject> holder, |
1113 Register holder_reg, | 1113 Register holder_reg, |
1114 Register scratch1, | 1114 Register scratch1, |
1115 Register scratch2, | 1115 Register scratch2, |
1116 Handle<Name> name, | 1116 Handle<Name> name, |
1117 int save_at_depth, | 1117 int save_at_depth, |
1118 Label* miss, | 1118 Label* miss, |
1119 PrototypeCheckType check) { | 1119 PrototypeCheckType check) { |
1120 Handle<Map> receiver_map(IC::TypeToMap(*type, isolate())); | 1120 Handle<Map> receiver_map(IC::TypeToMap(*type, isolate())); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 Label success; | 1246 Label success; |
1247 __ Branch(&success); | 1247 __ Branch(&success); |
1248 GenerateRestoreName(masm(), miss, name); | 1248 GenerateRestoreName(masm(), miss, name); |
1249 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1249 TailCallBuiltin(masm(), MissBuiltin(kind())); |
1250 __ bind(&success); | 1250 __ bind(&success); |
1251 } | 1251 } |
1252 } | 1252 } |
1253 | 1253 |
1254 | 1254 |
1255 Register LoadStubCompiler::CallbackHandlerFrontend( | 1255 Register LoadStubCompiler::CallbackHandlerFrontend( |
1256 Handle<Type> type, | 1256 Handle<HeapType> type, |
1257 Register object_reg, | 1257 Register object_reg, |
1258 Handle<JSObject> holder, | 1258 Handle<JSObject> holder, |
1259 Handle<Name> name, | 1259 Handle<Name> name, |
1260 Handle<Object> callback) { | 1260 Handle<Object> callback) { |
1261 Label miss; | 1261 Label miss; |
1262 | 1262 |
1263 Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss); | 1263 Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss); |
1264 | 1264 |
1265 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { | 1265 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { |
1266 ASSERT(!reg.is(scratch2())); | 1266 ASSERT(!reg.is(scratch2())); |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1912 | 1912 |
1913 // Handle store cache miss. | 1913 // Handle store cache miss. |
1914 __ bind(&miss); | 1914 __ bind(&miss); |
1915 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1915 TailCallBuiltin(masm(), MissBuiltin(kind())); |
1916 | 1916 |
1917 // Return the generated code. | 1917 // Return the generated code. |
1918 return GetCode(kind(), Code::FAST, name); | 1918 return GetCode(kind(), Code::FAST, name); |
1919 } | 1919 } |
1920 | 1920 |
1921 | 1921 |
1922 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type, | 1922 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type, |
1923 Handle<JSObject> last, | 1923 Handle<JSObject> last, |
1924 Handle<Name> name) { | 1924 Handle<Name> name) { |
1925 NonexistentHandlerFrontend(type, last, name); | 1925 NonexistentHandlerFrontend(type, last, name); |
1926 | 1926 |
1927 // Return undefined if maps of the full prototype chain is still the same. | 1927 // Return undefined if maps of the full prototype chain is still the same. |
1928 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 1928 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
1929 __ Ret(); | 1929 __ Ret(); |
1930 | 1930 |
1931 // Return the generated code. | 1931 // Return the generated code. |
1932 return GetCode(kind(), Code::FAST, name); | 1932 return GetCode(kind(), Code::FAST, name); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1994 } | 1994 } |
1995 __ Ret(); | 1995 __ Ret(); |
1996 } | 1996 } |
1997 | 1997 |
1998 | 1998 |
1999 #undef __ | 1999 #undef __ |
2000 #define __ ACCESS_MASM(masm()) | 2000 #define __ ACCESS_MASM(masm()) |
2001 | 2001 |
2002 | 2002 |
2003 Handle<Code> LoadStubCompiler::CompileLoadGlobal( | 2003 Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
2004 Handle<Type> type, | 2004 Handle<HeapType> type, |
2005 Handle<GlobalObject> global, | 2005 Handle<GlobalObject> global, |
2006 Handle<PropertyCell> cell, | 2006 Handle<PropertyCell> cell, |
2007 Handle<Name> name, | 2007 Handle<Name> name, |
2008 bool is_dont_delete) { | 2008 bool is_dont_delete) { |
2009 Label miss; | 2009 Label miss; |
2010 | 2010 |
2011 HandlerFrontendHeader(type, receiver(), global, name, &miss); | 2011 HandlerFrontendHeader(type, receiver(), global, name, &miss); |
2012 | 2012 |
2013 // Get the value from the cell. | 2013 // Get the value from the cell. |
2014 __ li(a3, Operand(cell)); | 2014 __ li(a3, Operand(cell)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2048 Label number_case; | 2048 Label number_case; |
2049 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; | 2049 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; |
2050 __ JumpIfSmi(receiver(), smi_target); | 2050 __ JumpIfSmi(receiver(), smi_target); |
2051 | 2051 |
2052 Register map_reg = scratch1(); | 2052 Register map_reg = scratch1(); |
2053 | 2053 |
2054 int receiver_count = types->length(); | 2054 int receiver_count = types->length(); |
2055 int number_of_handled_maps = 0; | 2055 int number_of_handled_maps = 0; |
2056 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 2056 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
2057 for (int current = 0; current < receiver_count; ++current) { | 2057 for (int current = 0; current < receiver_count; ++current) { |
2058 Handle<Type> type = types->at(current); | 2058 Handle<HeapType> type = types->at(current); |
2059 Handle<Map> map = IC::TypeToMap(*type, isolate()); | 2059 Handle<Map> map = IC::TypeToMap(*type, isolate()); |
2060 if (!map->is_deprecated()) { | 2060 if (!map->is_deprecated()) { |
2061 number_of_handled_maps++; | 2061 number_of_handled_maps++; |
2062 if (type->Is(Type::Number())) { | 2062 if (type->Is(HeapType::Number())) { |
2063 ASSERT(!number_case.is_unused()); | 2063 ASSERT(!number_case.is_unused()); |
2064 __ bind(&number_case); | 2064 __ bind(&number_case); |
2065 } | 2065 } |
2066 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, | 2066 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, |
2067 eq, map_reg, Operand(map)); | 2067 eq, map_reg, Operand(map)); |
2068 } | 2068 } |
2069 } | 2069 } |
2070 ASSERT(number_of_handled_maps != 0); | 2070 ASSERT(number_of_handled_maps != 0); |
2071 | 2071 |
2072 __ bind(&miss); | 2072 __ bind(&miss); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 // ----------------------------------- | 2155 // ----------------------------------- |
2156 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2156 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
2157 } | 2157 } |
2158 | 2158 |
2159 | 2159 |
2160 #undef __ | 2160 #undef __ |
2161 | 2161 |
2162 } } // namespace v8::internal | 2162 } } // namespace v8::internal |
2163 | 2163 |
2164 #endif // V8_TARGET_ARCH_MIPS | 2164 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |