Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 Runtime::SetObjectProperty(object, key, value, attributes, strict), | 258 Runtime::SetObjectProperty(object, key, value, attributes, strict), |
| 259 Object); | 259 Object); |
| 260 } | 260 } |
| 261 | 261 |
| 262 | 262 |
| 263 Handle<Object> ForceSetProperty(Handle<JSObject> object, | 263 Handle<Object> ForceSetProperty(Handle<JSObject> object, |
| 264 Handle<Object> key, | 264 Handle<Object> key, |
| 265 Handle<Object> value, | 265 Handle<Object> value, |
| 266 PropertyAttributes attributes) { | 266 PropertyAttributes attributes) { |
| 267 CALL_HEAP_FUNCTION( | 267 CALL_HEAP_FUNCTION( |
| 268 Runtime::ForceSetObjectProperty(object, key, value, attributes), Object); | 268 Runtime::ForceSetObjectProperty( |
| 269 object, key, value, attributes), | |
|
Martin Maly
2011/03/03 06:07:57
fixed the whitespace :)
| |
| 270 Object); | |
| 269 } | 271 } |
| 270 | 272 |
| 271 | 273 |
| 272 Handle<Object> SetNormalizedProperty(Handle<JSObject> object, | 274 Handle<Object> SetNormalizedProperty(Handle<JSObject> object, |
| 273 Handle<String> key, | 275 Handle<String> key, |
| 274 Handle<Object> value, | 276 Handle<Object> value, |
| 275 PropertyDetails details) { | 277 PropertyDetails details) { |
| 276 CALL_HEAP_FUNCTION(object->SetNormalizedProperty(*key, *value, details), | 278 CALL_HEAP_FUNCTION(object->SetNormalizedProperty(*key, *value, details), |
| 277 Object); | 279 Object); |
| 278 } | 280 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 419 Handle<String> SubString(Handle<String> str, | 421 Handle<String> SubString(Handle<String> str, |
| 420 int start, | 422 int start, |
| 421 int end, | 423 int end, |
| 422 PretenureFlag pretenure) { | 424 PretenureFlag pretenure) { |
| 423 CALL_HEAP_FUNCTION(str->SubString(start, end, pretenure), String); | 425 CALL_HEAP_FUNCTION(str->SubString(start, end, pretenure), String); |
| 424 } | 426 } |
| 425 | 427 |
| 426 | 428 |
| 427 Handle<Object> SetElement(Handle<JSObject> object, | 429 Handle<Object> SetElement(Handle<JSObject> object, |
| 428 uint32_t index, | 430 uint32_t index, |
| 429 Handle<Object> value) { | 431 Handle<Object> value, |
| 432 StrictModeFlag strict_mode) { | |
| 430 if (object->HasPixelElements() || object->HasExternalArrayElements()) { | 433 if (object->HasPixelElements() || object->HasExternalArrayElements()) { |
| 431 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { | 434 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { |
| 432 bool has_exception; | 435 bool has_exception; |
| 433 Handle<Object> number = Execution::ToNumber(value, &has_exception); | 436 Handle<Object> number = Execution::ToNumber(value, &has_exception); |
| 434 if (has_exception) return Handle<Object>(); | 437 if (has_exception) return Handle<Object>(); |
| 435 value = number; | 438 value = number; |
| 436 } | 439 } |
| 437 } | 440 } |
| 438 CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object); | 441 CALL_HEAP_FUNCTION(object->SetElement(index, *value, strict_mode), Object); |
| 439 } | 442 } |
| 440 | 443 |
| 441 | 444 |
| 442 Handle<Object> SetOwnElement(Handle<JSObject> object, | 445 Handle<Object> SetOwnElement(Handle<JSObject> object, |
| 443 uint32_t index, | 446 uint32_t index, |
| 444 Handle<Object> value) { | 447 Handle<Object> value, |
| 448 StrictModeFlag strict_mode) { | |
| 445 ASSERT(!object->HasPixelElements()); | 449 ASSERT(!object->HasPixelElements()); |
| 446 ASSERT(!object->HasExternalArrayElements()); | 450 ASSERT(!object->HasExternalArrayElements()); |
| 447 CALL_HEAP_FUNCTION(object->SetElement(index, *value, false), Object); | 451 CALL_HEAP_FUNCTION(object->SetElement(index, *value, strict_mode, false), |
| 452 Object); | |
| 448 } | 453 } |
| 449 | 454 |
| 450 | 455 |
| 451 Handle<JSObject> Copy(Handle<JSObject> obj) { | 456 Handle<JSObject> Copy(Handle<JSObject> obj) { |
| 452 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject); | 457 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject); |
| 453 } | 458 } |
| 454 | 459 |
| 455 | 460 |
| 456 Handle<Object> SetAccessor(Handle<JSObject> obj, Handle<AccessorInfo> info) { | 461 Handle<Object> SetAccessor(Handle<JSObject> obj, Handle<AccessorInfo> info) { |
| 457 CALL_HEAP_FUNCTION(obj->DefineAccessor(*info), Object); | 462 CALL_HEAP_FUNCTION(obj->DefineAccessor(*info), Object); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 901 | 906 |
| 902 OptimizedObjectForAddingMultipleProperties:: | 907 OptimizedObjectForAddingMultipleProperties:: |
| 903 ~OptimizedObjectForAddingMultipleProperties() { | 908 ~OptimizedObjectForAddingMultipleProperties() { |
| 904 // Reoptimize the object to allow fast property access. | 909 // Reoptimize the object to allow fast property access. |
| 905 if (has_been_transformed_) { | 910 if (has_been_transformed_) { |
| 906 TransformToFastProperties(object_, unused_property_fields_); | 911 TransformToFastProperties(object_, unused_property_fields_); |
| 907 } | 912 } |
| 908 } | 913 } |
| 909 | 914 |
| 910 } } // namespace v8::internal | 915 } } // namespace v8::internal |
| OLD | NEW |