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 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 bool is_const = value->IsTheHole(); | 1293 bool is_const = value->IsTheHole(); |
1294 bool is_function = value->IsSharedFunctionInfo(); | 1294 bool is_function = value->IsSharedFunctionInfo(); |
1295 bool is_module = value->IsJSModule(); | 1295 bool is_module = value->IsJSModule(); |
1296 ASSERT(is_var + is_const + is_function + is_module == 1); | 1296 ASSERT(is_var + is_const + is_function + is_module == 1); |
1297 | 1297 |
1298 if (is_var || is_const) { | 1298 if (is_var || is_const) { |
1299 // Lookup the property in the global object, and don't set the | 1299 // Lookup the property in the global object, and don't set the |
1300 // value of the variable if the property is already there. | 1300 // value of the variable if the property is already there. |
1301 // Do the lookup locally only, see ES5 errata. | 1301 // Do the lookup locally only, see ES5 errata. |
1302 LookupResult lookup(isolate); | 1302 LookupResult lookup(isolate); |
1303 global->LocalLookup(*name, &lookup); | 1303 if (FLAG_es52_globals) |
| 1304 global->LocalLookup(*name, &lookup); |
| 1305 else |
| 1306 global->Lookup(*name, &lookup); |
1304 if (lookup.IsProperty()) { | 1307 if (lookup.IsProperty()) { |
1305 // We found an existing property. Unless it was an interceptor | 1308 // We found an existing property. Unless it was an interceptor |
1306 // that claims the property is absent, skip this declaration. | 1309 // that claims the property is absent, skip this declaration. |
1307 if (lookup.type() != INTERCEPTOR) continue; | 1310 if (lookup.type() != INTERCEPTOR) continue; |
1308 PropertyAttributes attributes = global->GetPropertyAttribute(*name); | 1311 PropertyAttributes attributes = global->GetPropertyAttribute(*name); |
1309 if (attributes != ABSENT) continue; | 1312 if (attributes != ABSENT) continue; |
1310 // Fall-through and introduce the absent property by using | 1313 // Fall-through and introduce the absent property by using |
1311 // SetProperty. | 1314 // SetProperty. |
1312 } | 1315 } |
1313 } else if (is_function) { | 1316 } else if (is_function) { |
(...skipping 12052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13366 // Handle last resort GC and make sure to allow future allocations | 13369 // Handle last resort GC and make sure to allow future allocations |
13367 // to grow the heap without causing GCs (if possible). | 13370 // to grow the heap without causing GCs (if possible). |
13368 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13371 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13369 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13372 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13370 "Runtime::PerformGC"); | 13373 "Runtime::PerformGC"); |
13371 } | 13374 } |
13372 } | 13375 } |
13373 | 13376 |
13374 | 13377 |
13375 } } // namespace v8::internal | 13378 } } // namespace v8::internal |
OLD | NEW |