| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 Handle<JSObject> receiver) { | 170 Handle<JSObject> receiver) { |
| 171 // If no global objects are present in the prototype chain, the load | 171 // If no global objects are present in the prototype chain, the load |
| 172 // nonexistent IC stub can be shared for all names for a given map | 172 // nonexistent IC stub can be shared for all names for a given map |
| 173 // and we use the empty string for the map cache in that case. If | 173 // and we use the empty string for the map cache in that case. If |
| 174 // there are global objects involved, we need to check global | 174 // there are global objects involved, we need to check global |
| 175 // property cells in the stub and therefore the stub will be | 175 // property cells in the stub and therefore the stub will be |
| 176 // specific to the name. | 176 // specific to the name. |
| 177 Handle<Name> cache_name = factory()->empty_string(); | 177 Handle<Name> cache_name = factory()->empty_string(); |
| 178 Handle<JSObject> current; | 178 Handle<JSObject> current; |
| 179 Handle<Object> next = receiver; | 179 Handle<Object> next = receiver; |
| 180 Handle<GlobalObject> global; | 180 Handle<JSGlobalObject> global; |
| 181 do { | 181 do { |
| 182 current = Handle<JSObject>::cast(next); | 182 current = Handle<JSObject>::cast(next); |
| 183 next = Handle<Object>(current->GetPrototype(), isolate_); | 183 next = Handle<Object>(current->GetPrototype(), isolate_); |
| 184 if (current->IsGlobalObject()) { | 184 if (current->IsJSGlobalObject()) { |
| 185 global = Handle<GlobalObject>::cast(current); | 185 global = Handle<JSGlobalObject>::cast(current); |
| 186 cache_name = name; | 186 cache_name = name; |
| 187 } else if (!current->HasFastProperties()) { | 187 } else if (!current->HasFastProperties()) { |
| 188 cache_name = name; | 188 cache_name = name; |
| 189 } | 189 } |
| 190 } while (!next->IsNull()); | 190 } while (!next->IsNull()); |
| 191 | 191 |
| 192 // Compile the stub that is either shared for all names or | 192 // Compile the stub that is either shared for all names or |
| 193 // name specific if there are global objects involved. | 193 // name specific if there are global objects involved. |
| 194 Handle<Code> handler = FindHandler(cache_name, receiver, Code::LOAD_IC); | 194 Handle<Code> handler = FindHandler(cache_name, receiver, Code::LOAD_IC); |
| 195 if (!handler.is_null()) return handler; | 195 if (!handler.is_null()) return handler; |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 HandlerFrontendFooter(name, success, &miss); | 1206 HandlerFrontendFooter(name, success, &miss); |
| 1207 return reg; | 1207 return reg; |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 | 1210 |
| 1211 void LoadStubCompiler::NonexistentHandlerFrontend( | 1211 void LoadStubCompiler::NonexistentHandlerFrontend( |
| 1212 Handle<JSObject> object, | 1212 Handle<JSObject> object, |
| 1213 Handle<JSObject> last, | 1213 Handle<JSObject> last, |
| 1214 Handle<Name> name, | 1214 Handle<Name> name, |
| 1215 Label* success, | 1215 Label* success, |
| 1216 Handle<GlobalObject> global) { | 1216 Handle<JSGlobalObject> global) { |
| 1217 Label miss; | 1217 Label miss; |
| 1218 | 1218 |
| 1219 Register holder = | 1219 Register holder = |
| 1220 HandlerFrontendHeader(object, receiver(), last, name, &miss); | 1220 HandlerFrontendHeader(object, receiver(), last, name, &miss); |
| 1221 | 1221 |
| 1222 if (!last->HasFastProperties() && | 1222 if (!last->HasFastProperties() && |
| 1223 !last->IsJSGlobalObject() && | 1223 !last->IsJSGlobalObject() && |
| 1224 !last->IsJSGlobalProxy()) { | 1224 !last->IsJSGlobalProxy()) { |
| 1225 if (!name->IsUniqueName()) { | 1225 if (!name->IsUniqueName()) { |
| 1226 ASSERT(name->IsString()); | 1226 ASSERT(name->IsString()); |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1851 Handle<FunctionTemplateInfo>( | 1851 Handle<FunctionTemplateInfo>( |
| 1852 FunctionTemplateInfo::cast(signature->receiver())); | 1852 FunctionTemplateInfo::cast(signature->receiver())); |
| 1853 } | 1853 } |
| 1854 } | 1854 } |
| 1855 | 1855 |
| 1856 is_simple_api_call_ = true; | 1856 is_simple_api_call_ = true; |
| 1857 } | 1857 } |
| 1858 | 1858 |
| 1859 | 1859 |
| 1860 } } // namespace v8::internal | 1860 } } // namespace v8::internal |
| OLD | NEW |