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

Unified Diff: src/objects-inl.h

Issue 1180753005: Cleanup typed array setters, the property is guaranteed to be there. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 86a3fe7b35bc7455b830902ad8029959589592b9..2b7ea9aa1ab0fc0888254f37ab08907d2176cf62 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4001,27 +4001,21 @@ Handle<Object> FixedTypedArray<Traits>::get(
template <class Traits>
-void FixedTypedArray<Traits>::SetValue(Handle<JSObject> holder,
- Handle<FixedTypedArray<Traits> > array,
+void FixedTypedArray<Traits>::SetValue(Handle<FixedTypedArray<Traits> > array,
uint32_t index, Handle<Object> value) {
ElementType cast_value = Traits::defaultValue();
- Handle<JSArrayBufferView> view = Handle<JSArrayBufferView>::cast(holder);
- if (!view->WasNeutered()) {
- if (index < static_cast<uint32_t>(array->length())) {
- if (value->IsSmi()) {
- int int_value = Handle<Smi>::cast(value)->value();
- cast_value = from_int(int_value);
- } else if (value->IsHeapNumber()) {
- double double_value = Handle<HeapNumber>::cast(value)->value();
- cast_value = from_double(double_value);
- } else {
- // Clamp undefined to the default value. All other types have been
- // converted to a number type further up in the call chain.
- DCHECK(value->IsUndefined());
- }
- array->set(index, cast_value);
- }
+ if (value->IsSmi()) {
+ int int_value = Handle<Smi>::cast(value)->value();
+ cast_value = from_int(int_value);
+ } else if (value->IsHeapNumber()) {
+ double double_value = Handle<HeapNumber>::cast(value)->value();
+ cast_value = from_double(double_value);
+ } else {
+ // Clamp undefined to the default value. All other types have been
+ // converted to a number type further up in the call chain.
+ DCHECK(value->IsUndefined());
}
+ array->set(index, cast_value);
}
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698