| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 PretenureFlag pretenure) { | 471 PretenureFlag pretenure) { |
| 472 CALL_HEAP_FUNCTION(str->GetIsolate(), | 472 CALL_HEAP_FUNCTION(str->GetIsolate(), |
| 473 str->SubString(start, end, pretenure), String); | 473 str->SubString(start, end, pretenure), String); |
| 474 } | 474 } |
| 475 | 475 |
| 476 | 476 |
| 477 Handle<Object> SetElement(Handle<JSObject> object, | 477 Handle<Object> SetElement(Handle<JSObject> object, |
| 478 uint32_t index, | 478 uint32_t index, |
| 479 Handle<Object> value, | 479 Handle<Object> value, |
| 480 StrictModeFlag strict_mode) { | 480 StrictModeFlag strict_mode) { |
| 481 if (object->HasPixelElements() || object->HasExternalArrayElements()) { | 481 if (object->HasExternalArrayElements()) { |
| 482 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { | 482 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { |
| 483 bool has_exception; | 483 bool has_exception; |
| 484 Handle<Object> number = Execution::ToNumber(value, &has_exception); | 484 Handle<Object> number = Execution::ToNumber(value, &has_exception); |
| 485 if (has_exception) return Handle<Object>(); | 485 if (has_exception) return Handle<Object>(); |
| 486 value = number; | 486 value = number; |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 CALL_HEAP_FUNCTION(object->GetIsolate(), | 489 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 490 object->SetElement(index, *value, strict_mode), Object); | 490 object->SetElement(index, *value, strict_mode), Object); |
| 491 } | 491 } |
| 492 | 492 |
| 493 | 493 |
| 494 Handle<Object> SetOwnElement(Handle<JSObject> object, | 494 Handle<Object> SetOwnElement(Handle<JSObject> object, |
| 495 uint32_t index, | 495 uint32_t index, |
| 496 Handle<Object> value, | 496 Handle<Object> value, |
| 497 StrictModeFlag strict_mode) { | 497 StrictModeFlag strict_mode) { |
| 498 ASSERT(!object->HasPixelElements()); | |
| 499 ASSERT(!object->HasExternalArrayElements()); | 498 ASSERT(!object->HasExternalArrayElements()); |
| 500 CALL_HEAP_FUNCTION(object->GetIsolate(), | 499 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 501 object->SetElement(index, *value, strict_mode, false), | 500 object->SetElement(index, *value, strict_mode, false), |
| 502 Object); | 501 Object); |
| 503 } | 502 } |
| 504 | 503 |
| 505 | 504 |
| 506 Handle<JSObject> Copy(Handle<JSObject> obj) { | 505 Handle<JSObject> Copy(Handle<JSObject> obj) { |
| 507 Isolate* isolate = obj->GetIsolate(); | 506 Isolate* isolate = obj->GetIsolate(); |
| 508 CALL_HEAP_FUNCTION(isolate, | 507 CALL_HEAP_FUNCTION(isolate, |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 | 977 |
| 979 OptimizedObjectForAddingMultipleProperties:: | 978 OptimizedObjectForAddingMultipleProperties:: |
| 980 ~OptimizedObjectForAddingMultipleProperties() { | 979 ~OptimizedObjectForAddingMultipleProperties() { |
| 981 // Reoptimize the object to allow fast property access. | 980 // Reoptimize the object to allow fast property access. |
| 982 if (has_been_transformed_) { | 981 if (has_been_transformed_) { |
| 983 TransformToFastProperties(object_, unused_property_fields_); | 982 TransformToFastProperties(object_, unused_property_fields_); |
| 984 } | 983 } |
| 985 } | 984 } |
| 986 | 985 |
| 987 } } // namespace v8::internal | 986 } } // namespace v8::internal |
| OLD | NEW |