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

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: new approach: hide internals in anonymous closure 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') | src/promise.js » ('J')
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 14178 matching lines...) Expand 10 before | Expand all | Expand 10 after
14189 counter++; 14189 counter++;
14190 } 14190 }
14191 } 14191 }
14192 ASSERT(!storage || storage->length() >= counter); 14192 ASSERT(!storage || storage->length() >= counter);
14193 break; 14193 break;
14194 } 14194 }
14195 case FAST_DOUBLE_ELEMENTS: 14195 case FAST_DOUBLE_ELEMENTS:
14196 case FAST_HOLEY_DOUBLE_ELEMENTS: { 14196 case FAST_HOLEY_DOUBLE_ELEMENTS: {
14197 int length = IsJSArray() ? 14197 int length = IsJSArray() ?
14198 Smi::cast(JSArray::cast(this)->length())->value() : 14198 Smi::cast(JSArray::cast(this)->length())->value() :
14199 FixedDoubleArray::cast(elements())->length(); 14199 FixedArrayBase::cast(elements())->length();
14200 for (int i = 0; i < length; i++) { 14200 for (int i = 0; i < length; i++) {
14201 if (!FixedDoubleArray::cast(elements())->is_the_hole(i)) { 14201 if (!FixedDoubleArray::cast(elements())->is_the_hole(i)) {
14202 if (storage != NULL) { 14202 if (storage != NULL) {
14203 storage->set(counter, Smi::FromInt(i)); 14203 storage->set(counter, Smi::FromInt(i));
14204 } 14204 }
14205 counter++; 14205 counter++;
14206 } 14206 }
14207 } 14207 }
14208 ASSERT(!storage || storage->length() >= counter); 14208 ASSERT(!storage || storage->length() >= counter);
14209 break; 14209 break;
(...skipping 3037 matching lines...) Expand 10 before | Expand all | Expand 10 after
17247 #define ERROR_MESSAGES_TEXTS(C, T) T, 17247 #define ERROR_MESSAGES_TEXTS(C, T) T,
17248 static const char* error_messages_[] = { 17248 static const char* error_messages_[] = {
17249 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17249 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17250 }; 17250 };
17251 #undef ERROR_MESSAGES_TEXTS 17251 #undef ERROR_MESSAGES_TEXTS
17252 return error_messages_[reason]; 17252 return error_messages_[reason];
17253 } 17253 }
17254 17254
17255 17255
17256 } } // namespace v8::internal 17256 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/promise.js » ('j') | src/promise.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698