OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 __ movq(rax, Operand(rsp, kPointerSize)); | 1137 __ movq(rax, Operand(rsp, kPointerSize)); |
1138 GenerateLoadConstant(object, holder, rax, rbx, rdx, value, name, &miss); | 1138 GenerateLoadConstant(object, holder, rax, rbx, rdx, value, name, &miss); |
1139 __ bind(&miss); | 1139 __ bind(&miss); |
1140 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1140 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1141 | 1141 |
1142 // Return the generated code. | 1142 // Return the generated code. |
1143 return GetCode(CONSTANT_FUNCTION, name); | 1143 return GetCode(CONSTANT_FUNCTION, name); |
1144 } | 1144 } |
1145 | 1145 |
1146 | 1146 |
| 1147 Object* LoadStubCompiler::CompileLoadNonExisting(JSObject* object) { |
| 1148 // ----------- S t a t e ------------- |
| 1149 // -- rcx : name |
| 1150 // -- rsp[0] : return address |
| 1151 // -- rsp[8] : receiver |
| 1152 // ----------------------------------- |
| 1153 Label miss; |
| 1154 |
| 1155 // Load receiver. |
| 1156 __ movq(rax, Operand(rsp, kPointerSize)); |
| 1157 |
| 1158 // Check the maps of the full prototype chain. |
| 1159 JSObject* last = object; |
| 1160 while (last->GetPrototype() != Heap::null_value()) { |
| 1161 last = JSObject::cast(last->GetPrototype()); |
| 1162 } |
| 1163 CheckPrototypes(object, rax, last, rbx, rdx, Heap::empty_string(), &miss); |
| 1164 |
| 1165 // Return undefined if maps of the full prototype chain is still the same. |
| 1166 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
| 1167 __ ret(0); |
| 1168 |
| 1169 __ bind(&miss); |
| 1170 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 1171 |
| 1172 // Return the generated code. |
| 1173 return GetCode(NON_EXISTING, Heap::empty_string()); |
| 1174 } |
| 1175 |
| 1176 |
1147 Object* LoadStubCompiler::CompileLoadField(JSObject* object, | 1177 Object* LoadStubCompiler::CompileLoadField(JSObject* object, |
1148 JSObject* holder, | 1178 JSObject* holder, |
1149 int index, | 1179 int index, |
1150 String* name) { | 1180 String* name) { |
1151 // ----------- S t a t e ------------- | 1181 // ----------- S t a t e ------------- |
1152 // -- rcx : name | 1182 // -- rcx : name |
1153 // -- rsp[0] : return address | 1183 // -- rsp[0] : return address |
1154 // -- rsp[8] : receiver | 1184 // -- rsp[8] : receiver |
1155 // ----------------------------------- | 1185 // ----------------------------------- |
1156 Label miss; | 1186 Label miss; |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 1989 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
1960 | 1990 |
1961 // Return the generated code. | 1991 // Return the generated code. |
1962 return GetCode(); | 1992 return GetCode(); |
1963 } | 1993 } |
1964 | 1994 |
1965 | 1995 |
1966 #undef __ | 1996 #undef __ |
1967 | 1997 |
1968 } } // namespace v8::internal | 1998 } } // namespace v8::internal |
OLD | NEW |