| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } | 283 } |
| 284 | 284 |
| 285 | 285 |
| 286 Handle<Object> ForceSetProperty(Handle<JSObject> object, | 286 Handle<Object> ForceSetProperty(Handle<JSObject> object, |
| 287 Handle<Object> key, | 287 Handle<Object> key, |
| 288 Handle<Object> value, | 288 Handle<Object> value, |
| 289 PropertyAttributes attributes) { | 289 PropertyAttributes attributes) { |
| 290 Isolate* isolate = object->GetIsolate(); | 290 Isolate* isolate = object->GetIsolate(); |
| 291 CALL_HEAP_FUNCTION( | 291 CALL_HEAP_FUNCTION( |
| 292 isolate, | 292 isolate, |
| 293 Runtime::ForceSetObjectProperty(isolate, object, key, value, attributes), | 293 Runtime::ForceSetObjectProperty( |
| 294 isolate, object, key, value, attributes), |
| 294 Object); | 295 Object); |
| 295 } | 296 } |
| 296 | 297 |
| 297 | 298 |
| 298 Handle<Object> SetNormalizedProperty(Handle<JSObject> object, | 299 Handle<Object> SetNormalizedProperty(Handle<JSObject> object, |
| 299 Handle<String> key, | 300 Handle<String> key, |
| 300 Handle<Object> value, | 301 Handle<Object> value, |
| 301 PropertyDetails details) { | 302 PropertyDetails details) { |
| 302 CALL_HEAP_FUNCTION(object->GetIsolate(), | 303 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 303 object->SetNormalizedProperty(*key, *value, details), | 304 object->SetNormalizedProperty(*key, *value, details), |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 int start, | 469 int start, |
| 469 int end, | 470 int end, |
| 470 PretenureFlag pretenure) { | 471 PretenureFlag pretenure) { |
| 471 CALL_HEAP_FUNCTION(str->GetIsolate(), | 472 CALL_HEAP_FUNCTION(str->GetIsolate(), |
| 472 str->SubString(start, end, pretenure), String); | 473 str->SubString(start, end, pretenure), String); |
| 473 } | 474 } |
| 474 | 475 |
| 475 | 476 |
| 476 Handle<Object> SetElement(Handle<JSObject> object, | 477 Handle<Object> SetElement(Handle<JSObject> object, |
| 477 uint32_t index, | 478 uint32_t index, |
| 478 Handle<Object> value) { | 479 Handle<Object> value, |
| 480 StrictModeFlag strict_mode) { |
| 479 if (object->HasPixelElements() || object->HasExternalArrayElements()) { | 481 if (object->HasPixelElements() || object->HasExternalArrayElements()) { |
| 480 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { | 482 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { |
| 481 bool has_exception; | 483 bool has_exception; |
| 482 Handle<Object> number = Execution::ToNumber(value, &has_exception); | 484 Handle<Object> number = Execution::ToNumber(value, &has_exception); |
| 483 if (has_exception) return Handle<Object>(); | 485 if (has_exception) return Handle<Object>(); |
| 484 value = number; | 486 value = number; |
| 485 } | 487 } |
| 486 } | 488 } |
| 487 CALL_HEAP_FUNCTION(object->GetIsolate(), | 489 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 488 object->SetElement(index, *value), Object); | 490 object->SetElement(index, *value, strict_mode), Object); |
| 489 } | 491 } |
| 490 | 492 |
| 491 | 493 |
| 492 Handle<Object> SetOwnElement(Handle<JSObject> object, | 494 Handle<Object> SetOwnElement(Handle<JSObject> object, |
| 493 uint32_t index, | 495 uint32_t index, |
| 494 Handle<Object> value) { | 496 Handle<Object> value, |
| 497 StrictModeFlag strict_mode) { |
| 495 ASSERT(!object->HasPixelElements()); | 498 ASSERT(!object->HasPixelElements()); |
| 496 ASSERT(!object->HasExternalArrayElements()); | 499 ASSERT(!object->HasExternalArrayElements()); |
| 497 CALL_HEAP_FUNCTION(object->GetIsolate(), | 500 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 498 object->SetElement(index, *value, false), | 501 object->SetElement(index, *value, strict_mode, false), |
| 499 Object); | 502 Object); |
| 500 } | 503 } |
| 501 | 504 |
| 502 | 505 |
| 503 Handle<JSObject> Copy(Handle<JSObject> obj) { | 506 Handle<JSObject> Copy(Handle<JSObject> obj) { |
| 504 Isolate* isolate = obj->GetIsolate(); | 507 Isolate* isolate = obj->GetIsolate(); |
| 505 CALL_HEAP_FUNCTION(isolate, | 508 CALL_HEAP_FUNCTION(isolate, |
| 506 isolate->heap()->CopyJSObject(*obj), JSObject); | 509 isolate->heap()->CopyJSObject(*obj), JSObject); |
| 507 } | 510 } |
| 508 | 511 |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 | 978 |
| 976 OptimizedObjectForAddingMultipleProperties:: | 979 OptimizedObjectForAddingMultipleProperties:: |
| 977 ~OptimizedObjectForAddingMultipleProperties() { | 980 ~OptimizedObjectForAddingMultipleProperties() { |
| 978 // Reoptimize the object to allow fast property access. | 981 // Reoptimize the object to allow fast property access. |
| 979 if (has_been_transformed_) { | 982 if (has_been_transformed_) { |
| 980 TransformToFastProperties(object_, unused_property_fields_); | 983 TransformToFastProperties(object_, unused_property_fields_); |
| 981 } | 984 } |
| 982 } | 985 } |
| 983 | 986 |
| 984 } } // namespace v8::internal | 987 } } // namespace v8::internal |
| OLD | NEW |