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

Side by Side Diff: src/hydrogen.cc

Issue 279773002: Fix Array.prototype.push and Array.prototype.unshift for read-only length. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Whitespace Created 6 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/builtins.cc ('k') | src/ic.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "hydrogen.h" 5 #include "hydrogen.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "v8.h" 9 #include "v8.h"
10 #include "allocation-site-scopes.h" 10 #include "allocation-site-scopes.h"
(...skipping 7860 matching lines...) Expand 10 before | Expand all | Expand 10 after
7871 7871
7872 ast_context()->ReturnValue(result); 7872 ast_context()->ReturnValue(result);
7873 return true; 7873 return true;
7874 } 7874 }
7875 case kArrayPush: { 7875 case kArrayPush: {
7876 if (receiver_map.is_null()) return false; 7876 if (receiver_map.is_null()) return false;
7877 if (receiver_map->instance_type() != JS_ARRAY_TYPE) return false; 7877 if (receiver_map->instance_type() != JS_ARRAY_TYPE) return false;
7878 ElementsKind elements_kind = receiver_map->elements_kind(); 7878 ElementsKind elements_kind = receiver_map->elements_kind();
7879 if (!IsFastElementsKind(elements_kind)) return false; 7879 if (!IsFastElementsKind(elements_kind)) return false;
7880 if (receiver_map->is_observed()) return false; 7880 if (receiver_map->is_observed()) return false;
7881 if (JSArray::IsReadOnlyLengthDescriptor(receiver_map)) return false;
7881 ASSERT(receiver_map->is_extensible()); 7882 ASSERT(receiver_map->is_extensible());
7882 7883
7883 // If there may be elements accessors in the prototype chain, the fast 7884 // If there may be elements accessors in the prototype chain, the fast
7884 // inlined version can't be used. 7885 // inlined version can't be used.
7885 if (receiver_map->DictionaryElementsInPrototypeChainOnly()) return false; 7886 if (receiver_map->DictionaryElementsInPrototypeChainOnly()) return false;
7886 // If there currently can be no elements accessors on the prototype chain, 7887 // If there currently can be no elements accessors on the prototype chain,
7887 // it doesn't mean that there won't be any later. Install a full prototype 7888 // it doesn't mean that there won't be any later. Install a full prototype
7888 // chain check to trap element accessors being installed on the prototype 7889 // chain check to trap element accessors being installed on the prototype
7889 // chain, which would cause elements to go to dictionary mode and result 7890 // chain, which would cause elements to go to dictionary mode and result
7890 // in a map change. 7891 // in a map change.
(...skipping 3911 matching lines...) Expand 10 before | Expand all | Expand 10 after
11802 if (ShouldProduceTraceOutput()) { 11803 if (ShouldProduceTraceOutput()) {
11803 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11804 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11804 } 11805 }
11805 11806
11806 #ifdef DEBUG 11807 #ifdef DEBUG
11807 graph_->Verify(false); // No full verify. 11808 graph_->Verify(false); // No full verify.
11808 #endif 11809 #endif
11809 } 11810 }
11810 11811
11811 } } // namespace v8::internal 11812 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698