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

Side by Side Diff: src/objects.cc

Issue 7013: - Optimized JSArray allocation in runtime system by using NewJSArrayWithEleme... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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/jsregexp.cc ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 4677 matching lines...) Expand 10 before | Expand all | Expand 10 after
4688 } 4688 }
4689 } 4689 }
4690 4690
4691 // Otherwise default to slow case. 4691 // Otherwise default to slow case.
4692 Object* obj = NormalizeElements(); 4692 Object* obj = NormalizeElements();
4693 if (obj->IsFailure()) return obj; 4693 if (obj->IsFailure()) return obj;
4694 ASSERT(!HasFastElements()); 4694 ASSERT(!HasFastElements());
4695 return SetElement(index, value); 4695 return SetElement(index, value);
4696 } 4696 }
4697 4697
4698
4699 Object* JSObject::SetElement(uint32_t index, Object* value) { 4698 Object* JSObject::SetElement(uint32_t index, Object* value) {
4700 // Check access rights if needed. 4699 // Check access rights if needed.
4701 if (IsAccessCheckNeeded() && 4700 if (IsAccessCheckNeeded() &&
4702 !Top::MayIndexedAccess(this, index, v8::ACCESS_SET)) { 4701 !Top::MayIndexedAccess(this, index, v8::ACCESS_SET)) {
4703 Top::ReportFailedAccessCheck(this, v8::ACCESS_SET); 4702 Top::ReportFailedAccessCheck(this, v8::ACCESS_SET);
4704 return value; 4703 return value;
4705 } 4704 }
4706 4705
4707 // Check for lookup interceptor 4706 // Check for lookup interceptor
4708 if (HasIndexedInterceptor()) { 4707 if (HasIndexedInterceptor()) {
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
6443 // No break point. 6442 // No break point.
6444 if (break_point_objects()->IsUndefined()) return 0; 6443 if (break_point_objects()->IsUndefined()) return 0;
6445 // Single beak point. 6444 // Single beak point.
6446 if (!break_point_objects()->IsFixedArray()) return 1; 6445 if (!break_point_objects()->IsFixedArray()) return 1;
6447 // Multiple break points. 6446 // Multiple break points.
6448 return FixedArray::cast(break_point_objects())->length(); 6447 return FixedArray::cast(break_point_objects())->length();
6449 } 6448 }
6450 6449
6451 6450
6452 } } // namespace v8::internal 6451 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/jsregexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698