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

Side by Side Diff: src/objects.cc

Issue 7787030: Merge r9213 into the 3.3 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.3/
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 3087 matching lines...) Expand 10 before | Expand all | Expand 10 after
3098 return isolate->heap()->false_value(); 3098 return isolate->heap()->false_value();
3099 } 3099 }
3100 3100
3101 if (IsJSGlobalProxy()) { 3101 if (IsJSGlobalProxy()) {
3102 Object* proto = GetPrototype(); 3102 Object* proto = GetPrototype();
3103 if (proto->IsNull()) return this; 3103 if (proto->IsNull()) return this;
3104 ASSERT(proto->IsJSGlobalObject()); 3104 ASSERT(proto->IsJSGlobalObject());
3105 return JSObject::cast(proto)->PreventExtensions(); 3105 return JSObject::cast(proto)->PreventExtensions();
3106 } 3106 }
3107 3107
3108 // It's not possible to seal objects with external array elements
3109 if (HasExternalArrayElements()) {
3110 HandleScope scope(isolate);
3111 Handle<Object> object(this);
3112 Handle<Object> error =
3113 isolate->factory()->NewTypeError(
3114 "cant_prevent_ext_external_array_elements",
3115 HandleVector(&object, 1));
3116 return isolate->Throw(*error);
3117 }
3118
3108 // If there are fast elements we normalize. 3119 // If there are fast elements we normalize.
3109 if (HasFastElements()) { 3120 if (HasFastElements()) {
3110 Object* ok; 3121 Object* ok;
3111 { MaybeObject* maybe_ok = NormalizeElements(); 3122 { MaybeObject* maybe_ok = NormalizeElements();
3112 if (!maybe_ok->ToObject(&ok)) return maybe_ok; 3123 if (!maybe_ok->ToObject(&ok)) return maybe_ok;
3113 } 3124 }
3114 } 3125 }
3115 // Make sure that we never go back to fast case. 3126 // Make sure that we never go back to fast case.
3116 element_dictionary()->set_requires_slow_elements(); 3127 element_dictionary()->set_requires_slow_elements();
3117 3128
(...skipping 7486 matching lines...) Expand 10 before | Expand all | Expand 10 after
10604 if (break_point_objects()->IsUndefined()) return 0; 10615 if (break_point_objects()->IsUndefined()) return 0;
10605 // Single beak point. 10616 // Single beak point.
10606 if (!break_point_objects()->IsFixedArray()) return 1; 10617 if (!break_point_objects()->IsFixedArray()) return 1;
10607 // Multiple break points. 10618 // Multiple break points.
10608 return FixedArray::cast(break_point_objects())->length(); 10619 return FixedArray::cast(break_point_objects())->length();
10609 } 10620 }
10610 #endif 10621 #endif
10611 10622
10612 10623
10613 } } // namespace v8::internal 10624 } } // 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