| 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 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 | 1310 |
| 1311 if (is_var || is_const) { | 1311 if (is_var || is_const) { |
| 1312 // Lookup the property in the global object, and don't set the | 1312 // Lookup the property in the global object, and don't set the |
| 1313 // value of the variable if the property is already there. | 1313 // value of the variable if the property is already there. |
| 1314 // Do the lookup locally only, see ES5 erratum. | 1314 // Do the lookup locally only, see ES5 erratum. |
| 1315 LookupResult lookup(isolate); | 1315 LookupResult lookup(isolate); |
| 1316 if (FLAG_es52_globals) { | 1316 if (FLAG_es52_globals) { |
| 1317 Object* obj = *global; | 1317 Object* obj = *global; |
| 1318 do { | 1318 do { |
| 1319 JSObject::cast(obj)->LocalLookup(*name, &lookup); | 1319 JSObject::cast(obj)->LocalLookup(*name, &lookup); |
| 1320 if (lookup.IsProperty()) break; |
| 1320 obj = obj->GetPrototype(); | 1321 obj = obj->GetPrototype(); |
| 1321 } while (!lookup.IsFound() && obj->IsJSObject() && | 1322 } while (obj->IsJSObject() && |
| 1322 JSObject::cast(obj)->map()->is_hidden_prototype()); | 1323 JSObject::cast(obj)->map()->is_hidden_prototype()); |
| 1323 } else { | 1324 } else { |
| 1324 global->Lookup(*name, &lookup); | 1325 global->Lookup(*name, &lookup); |
| 1325 } | 1326 } |
| 1326 if (lookup.IsProperty()) { | 1327 if (lookup.IsProperty()) { |
| 1327 // We found an existing property. Unless it was an interceptor | 1328 // We found an existing property. Unless it was an interceptor |
| 1328 // that claims the property is absent, skip this declaration. | 1329 // that claims the property is absent, skip this declaration. |
| 1329 if (lookup.type() != INTERCEPTOR) continue; | 1330 if (lookup.type() != INTERCEPTOR) continue; |
| 1330 PropertyAttributes attributes = global->GetPropertyAttribute(*name); | 1331 PropertyAttributes attributes = global->GetPropertyAttribute(*name); |
| 1331 if (attributes != ABSENT) continue; | 1332 if (attributes != ABSENT) continue; |
| (...skipping 12314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13646 // Handle last resort GC and make sure to allow future allocations | 13647 // Handle last resort GC and make sure to allow future allocations |
| 13647 // to grow the heap without causing GCs (if possible). | 13648 // to grow the heap without causing GCs (if possible). |
| 13648 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13649 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13649 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13650 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13650 "Runtime::PerformGC"); | 13651 "Runtime::PerformGC"); |
| 13651 } | 13652 } |
| 13652 } | 13653 } |
| 13653 | 13654 |
| 13654 | 13655 |
| 13655 } } // namespace v8::internal | 13656 } } // namespace v8::internal |
| OLD | NEW |