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

Side by Side Diff: src/objects.cc

Issue 10356071: Force checking of result on all functions in elements.h that return MaybeObject*. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 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.h ('k') | no next file » | 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 8603 matching lines...) Expand 10 before | Expand all | Expand 10 after
8614 MaybeObject* maybe = GetElementsTransitionMap(GetIsolate(), elements_kind); 8614 MaybeObject* maybe = GetElementsTransitionMap(GetIsolate(), elements_kind);
8615 if (!maybe->To(&new_map)) return maybe; 8615 if (!maybe->To(&new_map)) return maybe;
8616 } 8616 }
8617 8617
8618 FixedArrayBase* old_elements = elements(); 8618 FixedArrayBase* old_elements = elements();
8619 ElementsKind elements_kind = GetElementsKind(); 8619 ElementsKind elements_kind = GetElementsKind();
8620 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind); 8620 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind);
8621 ElementsKind to_kind = (elements_kind == FAST_SMI_ONLY_ELEMENTS) 8621 ElementsKind to_kind = (elements_kind == FAST_SMI_ONLY_ELEMENTS)
8622 ? FAST_SMI_ONLY_ELEMENTS 8622 ? FAST_SMI_ONLY_ELEMENTS
8623 : FAST_ELEMENTS; 8623 : FAST_ELEMENTS;
8624 // int copy_size = Min(old_elements_raw->length(), new_elements->length()); 8624 { MaybeObject* maybe_obj =
8625 accessor->CopyElements(this, new_elements, to_kind); 8625 accessor->CopyElements(this, new_elements, to_kind);
8626 if (maybe_obj->IsFailure()) return maybe_obj;
8627 }
8626 if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) { 8628 if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) {
8627 set_map_and_elements(new_map, new_elements); 8629 set_map_and_elements(new_map, new_elements);
8628 } else { 8630 } else {
8629 FixedArray* parameter_map = FixedArray::cast(old_elements); 8631 FixedArray* parameter_map = FixedArray::cast(old_elements);
8630 parameter_map->set(1, new_elements); 8632 parameter_map->set(1, new_elements);
8631 } 8633 }
8632 8634
8633 if (FLAG_trace_elements_transitions) { 8635 if (FLAG_trace_elements_transitions) {
8634 PrintElementsTransition(stdout, elements_kind, old_elements, 8636 PrintElementsTransition(stdout, elements_kind, old_elements,
8635 GetElementsKind(), new_elements); 8637 GetElementsKind(), new_elements);
(...skipping 23 matching lines...) Expand all
8659 8661
8660 Map* new_map; 8662 Map* new_map;
8661 { MaybeObject* maybe_obj = 8663 { MaybeObject* maybe_obj =
8662 GetElementsTransitionMap(heap->isolate(), FAST_DOUBLE_ELEMENTS); 8664 GetElementsTransitionMap(heap->isolate(), FAST_DOUBLE_ELEMENTS);
8663 if (!maybe_obj->To(&new_map)) return maybe_obj; 8665 if (!maybe_obj->To(&new_map)) return maybe_obj;
8664 } 8666 }
8665 8667
8666 FixedArrayBase* old_elements = elements(); 8668 FixedArrayBase* old_elements = elements();
8667 ElementsKind elements_kind = GetElementsKind(); 8669 ElementsKind elements_kind = GetElementsKind();
8668 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind); 8670 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind);
8669 accessor->CopyElements(this, elems, FAST_DOUBLE_ELEMENTS); 8671 { MaybeObject* maybe_obj =
8672 accessor->CopyElements(this, elems, FAST_DOUBLE_ELEMENTS);
8673 if (maybe_obj->IsFailure()) return maybe_obj;
8674 }
8670 if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) { 8675 if (elements_kind != NON_STRICT_ARGUMENTS_ELEMENTS) {
8671 set_map_and_elements(new_map, elems); 8676 set_map_and_elements(new_map, elems);
8672 } else { 8677 } else {
8673 FixedArray* parameter_map = FixedArray::cast(old_elements); 8678 FixedArray* parameter_map = FixedArray::cast(old_elements);
8674 parameter_map->set(1, elems); 8679 parameter_map->set(1, elems);
8675 } 8680 }
8676 8681
8677 if (FLAG_trace_elements_transitions) { 8682 if (FLAG_trace_elements_transitions) {
8678 PrintElementsTransition(stdout, elements_kind, old_elements, 8683 PrintElementsTransition(stdout, elements_kind, old_elements,
8679 FAST_DOUBLE_ELEMENTS, elems); 8684 FAST_DOUBLE_ELEMENTS, elems);
(...skipping 4425 matching lines...) Expand 10 before | Expand all | Expand 10 after
13105 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13110 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13106 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13111 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13107 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13112 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13108 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13113 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13109 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13114 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13110 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13115 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13111 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13116 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13112 } 13117 }
13113 13118
13114 } } // namespace v8::internal 13119 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/elements.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698