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

Side by Side Diff: src/objects.cc

Issue 7858033: Merge r9213 into the 3.5 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.5/
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 3397 matching lines...) Expand 10 before | Expand all | Expand 10 after
3408 return isolate->heap()->false_value(); 3408 return isolate->heap()->false_value();
3409 } 3409 }
3410 3410
3411 if (IsJSGlobalProxy()) { 3411 if (IsJSGlobalProxy()) {
3412 Object* proto = GetPrototype(); 3412 Object* proto = GetPrototype();
3413 if (proto->IsNull()) return this; 3413 if (proto->IsNull()) return this;
3414 ASSERT(proto->IsJSGlobalObject()); 3414 ASSERT(proto->IsJSGlobalObject());
3415 return JSObject::cast(proto)->PreventExtensions(); 3415 return JSObject::cast(proto)->PreventExtensions();
3416 } 3416 }
3417 3417
3418 // It's not possible to seal objects with external array elements
3419 if (HasExternalArrayElements()) {
3420 HandleScope scope(isolate);
3421 Handle<Object> object(this);
3422 Handle<Object> error =
3423 isolate->factory()->NewTypeError(
3424 "cant_prevent_ext_external_array_elements",
3425 HandleVector(&object, 1));
3426 return isolate->Throw(*error);
3427 }
3428
3418 // If there are fast elements we normalize. 3429 // If there are fast elements we normalize.
3419 NumberDictionary* dictionary = NULL; 3430 NumberDictionary* dictionary = NULL;
3420 { MaybeObject* maybe = NormalizeElements(); 3431 { MaybeObject* maybe = NormalizeElements();
3421 if (!maybe->To<NumberDictionary>(&dictionary)) return maybe; 3432 if (!maybe->To<NumberDictionary>(&dictionary)) return maybe;
3422 } 3433 }
3423 ASSERT(HasDictionaryElements() || HasDictionaryArgumentsElements()); 3434 ASSERT(HasDictionaryElements() || HasDictionaryArgumentsElements());
3424 // Make sure that we never go back to fast case. 3435 // Make sure that we never go back to fast case.
3425 dictionary->set_requires_slow_elements(); 3436 dictionary->set_requires_slow_elements();
3426 3437
3427 // Do a map transition, other objects with this map may still 3438 // Do a map transition, other objects with this map may still
(...skipping 8171 matching lines...) Expand 10 before | Expand all | Expand 10 after
11599 if (break_point_objects()->IsUndefined()) return 0; 11610 if (break_point_objects()->IsUndefined()) return 0;
11600 // Single break point. 11611 // Single break point.
11601 if (!break_point_objects()->IsFixedArray()) return 1; 11612 if (!break_point_objects()->IsFixedArray()) return 1;
11602 // Multiple break points. 11613 // Multiple break points.
11603 return FixedArray::cast(break_point_objects())->length(); 11614 return FixedArray::cast(break_point_objects())->length();
11604 } 11615 }
11605 #endif 11616 #endif
11606 11617
11607 11618
11608 } } // namespace v8::internal 11619 } } // 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