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

Side by Side Diff: src/objects.cc

Issue 7860043: Merge r9213 into the 3.4 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.4/
Patch Set: Created 9 years, 3 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/messages.js ('k') | src/runtime.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3438 matching lines...) Expand 10 before | Expand all | Expand 10 after
3449 return isolate->heap()->false_value(); 3449 return isolate->heap()->false_value();
3450 } 3450 }
3451 3451
3452 if (IsJSGlobalProxy()) { 3452 if (IsJSGlobalProxy()) {
3453 Object* proto = GetPrototype(); 3453 Object* proto = GetPrototype();
3454 if (proto->IsNull()) return this; 3454 if (proto->IsNull()) return this;
3455 ASSERT(proto->IsJSGlobalObject()); 3455 ASSERT(proto->IsJSGlobalObject());
3456 return JSObject::cast(proto)->PreventExtensions(); 3456 return JSObject::cast(proto)->PreventExtensions();
3457 } 3457 }
3458 3458
3459 // It's not possible to seal objects with external array elements
3460 if (HasExternalArrayElements()) {
3461 HandleScope scope(isolate);
3462 Handle<Object> object(this);
3463 Handle<Object> error =
3464 isolate->factory()->NewTypeError(
3465 "cant_prevent_ext_external_array_elements",
3466 HandleVector(&object, 1));
3467 return isolate->Throw(*error);
3468 }
3469
3459 // If there are fast elements we normalize. 3470 // If there are fast elements we normalize.
3460 NumberDictionary* dictionary = NULL; 3471 NumberDictionary* dictionary = NULL;
3461 { MaybeObject* maybe = NormalizeElements(); 3472 { MaybeObject* maybe = NormalizeElements();
3462 if (!maybe->To<NumberDictionary>(&dictionary)) return maybe; 3473 if (!maybe->To<NumberDictionary>(&dictionary)) return maybe;
3463 } 3474 }
3464 ASSERT(HasDictionaryElements() || HasDictionaryArgumentsElements()); 3475 ASSERT(HasDictionaryElements() || HasDictionaryArgumentsElements());
3465 // Make sure that we never go back to fast case. 3476 // Make sure that we never go back to fast case.
3466 dictionary->set_requires_slow_elements(); 3477 dictionary->set_requires_slow_elements();
3467 3478
3468 // Do a map transition, other objects with this map may still 3479 // Do a map transition, other objects with this map may still
(...skipping 8370 matching lines...) Expand 10 before | Expand all | Expand 10 after
11839 if (break_point_objects()->IsUndefined()) return 0; 11850 if (break_point_objects()->IsUndefined()) return 0;
11840 // Single beak point. 11851 // Single beak point.
11841 if (!break_point_objects()->IsFixedArray()) return 1; 11852 if (!break_point_objects()->IsFixedArray()) return 1;
11842 // Multiple break points. 11853 // Multiple break points.
11843 return FixedArray::cast(break_point_objects())->length(); 11854 return FixedArray::cast(break_point_objects())->length();
11844 } 11855 }
11845 #endif 11856 #endif
11846 11857
11847 11858
11848 } } // namespace v8::internal 11859 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698