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

Side by Side Diff: src/objects.cc

Issue 9808111: Fix missing write barrier in CopyObjectToObjectElements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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/elements.cc ('k') | test/mjsunit/regress/regress-crbug-119926.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 8436 matching lines...) Expand 10 before | Expand all | Expand 10 after
8447 if (!maybe->To(&new_map)) return maybe; 8447 if (!maybe->To(&new_map)) return maybe;
8448 } 8448 }
8449 8449
8450 FixedArrayBase* old_elements = elements(); 8450 FixedArrayBase* old_elements = elements();
8451 ElementsKind elements_kind = GetElementsKind(); 8451 ElementsKind elements_kind = GetElementsKind();
8452 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind); 8452 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind);
8453 ElementsKind to_kind = (elements_kind == FAST_SMI_ONLY_ELEMENTS) 8453 ElementsKind to_kind = (elements_kind == FAST_SMI_ONLY_ELEMENTS)
8454 ? FAST_SMI_ONLY_ELEMENTS 8454 ? FAST_SMI_ONLY_ELEMENTS
8455 : FAST_ELEMENTS; 8455 : FAST_ELEMENTS;
8456 // int copy_size = Min(old_elements_raw->length(), new_elements->length()); 8456 // int copy_size = Min(old_elements_raw->length(), new_elements->length());
8457 accessor->CopyElements(this, new_elements, to_kind, SKIP_WRITE_BARRIER); 8457 accessor->CopyElements(this, new_elements, to_kind);
8458 if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) { 8458 if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) {
8459 set_map_and_elements(new_map, new_elements); 8459 set_map_and_elements(new_map, new_elements);
8460 } else { 8460 } else {
8461 FixedArray* parameter_map = FixedArray::cast(old_elements); 8461 FixedArray* parameter_map = FixedArray::cast(old_elements);
8462 parameter_map->set(1, new_elements); 8462 parameter_map->set(1, new_elements);
8463 } 8463 }
8464 8464
8465 if (FLAG_trace_elements_transitions) { 8465 if (FLAG_trace_elements_transitions) {
8466 PrintElementsTransition(stdout, elements_kind, old_elements, 8466 PrintElementsTransition(stdout, elements_kind, old_elements,
8467 GetElementsKind(), new_elements); 8467 GetElementsKind(), new_elements);
(...skipping 23 matching lines...) Expand all
8491 8491
8492 Map* new_map; 8492 Map* new_map;
8493 { MaybeObject* maybe_obj = 8493 { MaybeObject* maybe_obj =
8494 GetElementsTransitionMap(heap->isolate(), FAST_DOUBLE_ELEMENTS); 8494 GetElementsTransitionMap(heap->isolate(), FAST_DOUBLE_ELEMENTS);
8495 if (!maybe_obj->To(&new_map)) return maybe_obj; 8495 if (!maybe_obj->To(&new_map)) return maybe_obj;
8496 } 8496 }
8497 8497
8498 FixedArrayBase* old_elements = elements(); 8498 FixedArrayBase* old_elements = elements();
8499 ElementsKind elements_kind = GetElementsKind(); 8499 ElementsKind elements_kind = GetElementsKind();
8500 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind); 8500 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind);
8501 accessor->CopyElements(this, elems, FAST_DOUBLE_ELEMENTS, 8501 accessor->CopyElements(this, elems, FAST_DOUBLE_ELEMENTS);
8502 SKIP_WRITE_BARRIER);
8503 if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) { 8502 if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) {
8504 set_map_and_elements(new_map, elems); 8503 set_map_and_elements(new_map, elems);
8505 } else { 8504 } else {
8506 FixedArray* parameter_map = FixedArray::cast(old_elements); 8505 FixedArray* parameter_map = FixedArray::cast(old_elements);
8507 parameter_map->set(1, elems); 8506 parameter_map->set(1, elems);
8508 } 8507 }
8509 8508
8510 if (FLAG_trace_elements_transitions) { 8509 if (FLAG_trace_elements_transitions) {
8511 PrintElementsTransition(stdout, elements_kind, old_elements, 8510 PrintElementsTransition(stdout, elements_kind, old_elements,
8512 FAST_DOUBLE_ELEMENTS, elems); 8511 FAST_DOUBLE_ELEMENTS, elems);
(...skipping 4425 matching lines...) Expand 10 before | Expand all | Expand 10 after
12938 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 12937 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
12939 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 12938 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
12940 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 12939 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
12941 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 12940 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
12942 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 12941 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
12943 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 12942 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
12944 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 12943 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
12945 } 12944 }
12946 12945
12947 } } // namespace v8::internal 12946 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | test/mjsunit/regress/regress-crbug-119926.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698