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

Side by Side Diff: src/objects.cc

Issue 292173011: Harden a few builtins (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased 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/isolate.cc ('k') | src/promise.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 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 "v8.h" 5 #include "v8.h"
6 6
7 #include "accessors.h" 7 #include "accessors.h"
8 #include "allocation-site-scopes.h" 8 #include "allocation-site-scopes.h"
9 #include "api.h" 9 #include "api.h"
10 #include "arguments.h" 10 #include "arguments.h"
(...skipping 14245 matching lines...) Expand 10 before | Expand all | Expand 10 after
14256 counter++; 14256 counter++;
14257 } 14257 }
14258 } 14258 }
14259 ASSERT(!storage || storage->length() >= counter); 14259 ASSERT(!storage || storage->length() >= counter);
14260 break; 14260 break;
14261 } 14261 }
14262 case FAST_DOUBLE_ELEMENTS: 14262 case FAST_DOUBLE_ELEMENTS:
14263 case FAST_HOLEY_DOUBLE_ELEMENTS: { 14263 case FAST_HOLEY_DOUBLE_ELEMENTS: {
14264 int length = IsJSArray() ? 14264 int length = IsJSArray() ?
14265 Smi::cast(JSArray::cast(this)->length())->value() : 14265 Smi::cast(JSArray::cast(this)->length())->value() :
14266 FixedDoubleArray::cast(elements())->length(); 14266 FixedArrayBase::cast(elements())->length();
14267 for (int i = 0; i < length; i++) { 14267 for (int i = 0; i < length; i++) {
14268 if (!FixedDoubleArray::cast(elements())->is_the_hole(i)) { 14268 if (!FixedDoubleArray::cast(elements())->is_the_hole(i)) {
14269 if (storage != NULL) { 14269 if (storage != NULL) {
14270 storage->set(counter, Smi::FromInt(i)); 14270 storage->set(counter, Smi::FromInt(i));
14271 } 14271 }
14272 counter++; 14272 counter++;
14273 } 14273 }
14274 } 14274 }
14275 ASSERT(!storage || storage->length() >= counter); 14275 ASSERT(!storage || storage->length() >= counter);
14276 break; 14276 break;
(...skipping 3042 matching lines...) Expand 10 before | Expand all | Expand 10 after
17319 #define ERROR_MESSAGES_TEXTS(C, T) T, 17319 #define ERROR_MESSAGES_TEXTS(C, T) T,
17320 static const char* error_messages_[] = { 17320 static const char* error_messages_[] = {
17321 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17321 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17322 }; 17322 };
17323 #undef ERROR_MESSAGES_TEXTS 17323 #undef ERROR_MESSAGES_TEXTS
17324 return error_messages_[reason]; 17324 return error_messages_[reason];
17325 } 17325 }
17326 17326
17327 17327
17328 } } // namespace v8::internal 17328 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698