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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 int start, | 414 int start, |
415 int end, | 415 int end, |
416 PretenureFlag pretenure) { | 416 PretenureFlag pretenure) { |
417 CALL_HEAP_FUNCTION(str->SubString(start, end, pretenure), String); | 417 CALL_HEAP_FUNCTION(str->SubString(start, end, pretenure), String); |
418 } | 418 } |
419 | 419 |
420 | 420 |
421 Handle<Object> SetElement(Handle<JSObject> object, | 421 Handle<Object> SetElement(Handle<JSObject> object, |
422 uint32_t index, | 422 uint32_t index, |
423 Handle<Object> value) { | 423 Handle<Object> value) { |
424 if (object->HasPixelElements() || object->HasExternalArrayElements()) { | 424 if (object->HasExternalArrayElements()) { |
425 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { | 425 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { |
426 bool has_exception; | 426 bool has_exception; |
427 Handle<Object> number = Execution::ToNumber(value, &has_exception); | 427 Handle<Object> number = Execution::ToNumber(value, &has_exception); |
428 if (has_exception) return Handle<Object>(); | 428 if (has_exception) return Handle<Object>(); |
429 value = number; | 429 value = number; |
430 } | 430 } |
431 } | 431 } |
432 CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object); | 432 CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object); |
433 } | 433 } |
434 | 434 |
435 | 435 |
436 Handle<Object> SetOwnElement(Handle<JSObject> object, | 436 Handle<Object> SetOwnElement(Handle<JSObject> object, |
437 uint32_t index, | 437 uint32_t index, |
438 Handle<Object> value) { | 438 Handle<Object> value) { |
439 ASSERT(!object->HasPixelElements()); | 439 ASSERT(!object->HasExternalPixelElements()); |
440 ASSERT(!object->HasExternalArrayElements()); | 440 ASSERT(!object->HasExternalArrayElements()); |
441 CALL_HEAP_FUNCTION(object->SetElement(index, *value, false), Object); | 441 CALL_HEAP_FUNCTION(object->SetElement(index, *value, false), Object); |
442 } | 442 } |
443 | 443 |
444 | 444 |
445 Handle<JSObject> Copy(Handle<JSObject> obj) { | 445 Handle<JSObject> Copy(Handle<JSObject> obj) { |
446 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject); | 446 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject); |
447 } | 447 } |
448 | 448 |
449 | 449 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 | 903 |
904 OptimizedObjectForAddingMultipleProperties:: | 904 OptimizedObjectForAddingMultipleProperties:: |
905 ~OptimizedObjectForAddingMultipleProperties() { | 905 ~OptimizedObjectForAddingMultipleProperties() { |
906 // Reoptimize the object to allow fast property access. | 906 // Reoptimize the object to allow fast property access. |
907 if (has_been_transformed_) { | 907 if (has_been_transformed_) { |
908 TransformToFastProperties(object_, unused_property_fields_); | 908 TransformToFastProperties(object_, unused_property_fields_); |
909 } | 909 } |
910 } | 910 } |
911 | 911 |
912 } } // namespace v8::internal | 912 } } // namespace v8::internal |
OLD | NEW |