Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: src/handles.cc

Issue 6546036: Combine typed and pixel arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: final version Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/factory.cc ('k') | src/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 int end, 423 int end,
424 PretenureFlag pretenure) { 424 PretenureFlag pretenure) {
425 CALL_HEAP_FUNCTION(str->SubString(start, end, pretenure), String); 425 CALL_HEAP_FUNCTION(str->SubString(start, end, pretenure), String);
426 } 426 }
427 427
428 428
429 Handle<Object> SetElement(Handle<JSObject> object, 429 Handle<Object> SetElement(Handle<JSObject> object,
430 uint32_t index, 430 uint32_t index,
431 Handle<Object> value, 431 Handle<Object> value,
432 StrictModeFlag strict_mode) { 432 StrictModeFlag strict_mode) {
433 if (object->HasPixelElements() || object->HasExternalArrayElements()) { 433 if (object->HasExternalArrayElements()) {
434 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { 434 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) {
435 bool has_exception; 435 bool has_exception;
436 Handle<Object> number = Execution::ToNumber(value, &has_exception); 436 Handle<Object> number = Execution::ToNumber(value, &has_exception);
437 if (has_exception) return Handle<Object>(); 437 if (has_exception) return Handle<Object>();
438 value = number; 438 value = number;
439 } 439 }
440 } 440 }
441 CALL_HEAP_FUNCTION(object->SetElement(index, *value, strict_mode), Object); 441 CALL_HEAP_FUNCTION(object->SetElement(index, *value, strict_mode), Object);
442 } 442 }
443 443
444 444
445 Handle<Object> SetOwnElement(Handle<JSObject> object, 445 Handle<Object> SetOwnElement(Handle<JSObject> object,
446 uint32_t index, 446 uint32_t index,
447 Handle<Object> value, 447 Handle<Object> value,
448 StrictModeFlag strict_mode) { 448 StrictModeFlag strict_mode) {
449 ASSERT(!object->HasPixelElements());
450 ASSERT(!object->HasExternalArrayElements()); 449 ASSERT(!object->HasExternalArrayElements());
451 CALL_HEAP_FUNCTION(object->SetElement(index, *value, strict_mode, false), 450 CALL_HEAP_FUNCTION(object->SetElement(index, *value, strict_mode, false),
452 Object); 451 Object);
453 } 452 }
454 453
455 454
456 Handle<JSObject> Copy(Handle<JSObject> obj) { 455 Handle<JSObject> Copy(Handle<JSObject> obj) {
457 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject); 456 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject);
458 } 457 }
459 458
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 905
907 OptimizedObjectForAddingMultipleProperties:: 906 OptimizedObjectForAddingMultipleProperties::
908 ~OptimizedObjectForAddingMultipleProperties() { 907 ~OptimizedObjectForAddingMultipleProperties() {
909 // Reoptimize the object to allow fast property access. 908 // Reoptimize the object to allow fast property access.
910 if (has_been_transformed_) { 909 if (has_been_transformed_) {
911 TransformToFastProperties(object_, unused_property_fields_); 910 TransformToFastProperties(object_, unused_property_fields_);
912 } 911 }
913 } 912 }
914 913
915 } } // namespace v8::internal 914 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698