OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 return ThrowRedeclarationError(type, name); | 390 return ThrowRedeclarationError(type, name); |
391 } | 391 } |
392 SetProperty(global, name, value, attributes); | 392 SetProperty(global, name, value, attributes); |
393 } else { | 393 } else { |
394 // If a property with this name does not already exist on the | 394 // If a property with this name does not already exist on the |
395 // global object add the property locally. We take special | 395 // global object add the property locally. We take special |
396 // precautions to always add it as a local property even in case | 396 // precautions to always add it as a local property even in case |
397 // of callbacks in the prototype chain (this rules out using | 397 // of callbacks in the prototype chain (this rules out using |
398 // SetProperty). Also, we must use the handle-based version to | 398 // SetProperty). Also, we must use the handle-based version to |
399 // avoid GC issues. | 399 // avoid GC issues. |
400 AddProperty(global, name, value, attributes); | 400 IgnoreAttributesAndSetLocalProperty(global, name, value, attributes); |
401 } | 401 } |
402 } | 402 } |
403 // Done. | 403 // Done. |
404 return Heap::undefined_value(); | 404 return Heap::undefined_value(); |
405 } | 405 } |
406 | 406 |
407 | 407 |
408 static Object* Runtime_DeclareContextSlot(Arguments args) { | 408 static Object* Runtime_DeclareContextSlot(Arguments args) { |
409 HandleScope scope; | 409 HandleScope scope; |
410 ASSERT(args.length() == 5); | 410 ASSERT(args.length() == 5); |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 | 1409 |
1410 // Set a local property, even if it is READ_ONLY. If the property does not | 1410 // Set a local property, even if it is READ_ONLY. If the property does not |
1411 // exist, it will be added with attributes NONE. | 1411 // exist, it will be added with attributes NONE. |
1412 static Object* Runtime_IgnoreAttributesAndSetProperty(Arguments args) { | 1412 static Object* Runtime_IgnoreAttributesAndSetProperty(Arguments args) { |
1413 NoHandleAllocation ha; | 1413 NoHandleAllocation ha; |
1414 ASSERT(args.length() == 3); | 1414 ASSERT(args.length() == 3); |
1415 | 1415 |
1416 CONVERT_CHECKED(JSObject, object, args[0]); | 1416 CONVERT_CHECKED(JSObject, object, args[0]); |
1417 CONVERT_CHECKED(String, name, args[1]); | 1417 CONVERT_CHECKED(String, name, args[1]); |
1418 | 1418 |
1419 return object->IgnoreAttributesAndSetLocalProperty(name, args[2]); | 1419 return object->IgnoreAttributesAndSetLocalProperty(name, args[2], NONE); |
1420 } | 1420 } |
1421 | 1421 |
1422 | 1422 |
1423 static Object* Runtime_DeleteProperty(Arguments args) { | 1423 static Object* Runtime_DeleteProperty(Arguments args) { |
1424 NoHandleAllocation ha; | 1424 NoHandleAllocation ha; |
1425 ASSERT(args.length() == 2); | 1425 ASSERT(args.length() == 2); |
1426 | 1426 |
1427 CONVERT_CHECKED(JSObject, object, args[0]); | 1427 CONVERT_CHECKED(JSObject, object, args[0]); |
1428 CONVERT_CHECKED(String, key, args[1]); | 1428 CONVERT_CHECKED(String, key, args[1]); |
1429 return object->DeleteProperty(key); | 1429 return object->DeleteProperty(key); |
(...skipping 3586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5016 | 5016 |
5017 void Runtime::PerformGC(Object* result) { | 5017 void Runtime::PerformGC(Object* result) { |
5018 Failure* failure = Failure::cast(result); | 5018 Failure* failure = Failure::cast(result); |
5019 // Try to do a garbage collection; ignore it if it fails. The C | 5019 // Try to do a garbage collection; ignore it if it fails. The C |
5020 // entry stub will throw an out-of-memory exception in that case. | 5020 // entry stub will throw an out-of-memory exception in that case. |
5021 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); | 5021 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); |
5022 } | 5022 } |
5023 | 5023 |
5024 | 5024 |
5025 } } // namespace v8::internal | 5025 } } // namespace v8::internal |
OLD | NEW |