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

Side by Side Diff: src/objects.cc

Issue 895573002: Check global object behind global proxy for extensibility (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 10 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
« no previous file with comments | « src/accessors.cc ('k') | test/mjsunit/regress/regress-crbug-454091.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 <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 12097 matching lines...) Expand 10 before | Expand all | Expand 10 after
12108 Handle<JSObject> real_receiver = object; 12108 Handle<JSObject> real_receiver = object;
12109 12109
12110 if (from_javascript) { 12110 if (from_javascript) {
12111 // Find the first object in the chain whose prototype object is not 12111 // Find the first object in the chain whose prototype object is not
12112 // hidden and set the new prototype on that object. 12112 // hidden and set the new prototype on that object.
12113 PrototypeIterator iter(isolate, real_receiver); 12113 PrototypeIterator iter(isolate, real_receiver);
12114 while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)) { 12114 while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)) {
12115 real_receiver = 12115 real_receiver =
12116 Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)); 12116 Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
12117 iter.Advance(); 12117 iter.Advance();
12118 if (!real_receiver->map()->is_extensible()) {
12119 Handle<Object> args[] = {object};
12120 THROW_NEW_ERROR(isolate,
12121 NewTypeError("non_extensible_proto",
12122 HandleVector(args, arraysize(args))),
12123 Object);
12124 }
12118 } 12125 }
12119 } 12126 }
12120 12127
12121 // Set the new prototype of the object. 12128 // Set the new prototype of the object.
12122 Handle<Map> map(real_receiver->map()); 12129 Handle<Map> map(real_receiver->map());
12123 12130
12124 // Nothing to do if prototype is already set. 12131 // Nothing to do if prototype is already set.
12125 if (map->prototype() == *value) return value; 12132 if (map->prototype() == *value) return value;
12126 12133
12127 PrototypeOptimizationMode mode = 12134 PrototypeOptimizationMode mode =
(...skipping 4751 matching lines...) Expand 10 before | Expand all | Expand 10 after
16879 Handle<DependentCode> codes = 16886 Handle<DependentCode> codes =
16880 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 16887 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16881 DependentCode::kPropertyCellChangedGroup, 16888 DependentCode::kPropertyCellChangedGroup,
16882 info->object_wrapper()); 16889 info->object_wrapper());
16883 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 16890 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16884 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16891 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16885 cell, info->zone()); 16892 cell, info->zone());
16886 } 16893 }
16887 16894
16888 } } // namespace v8::internal 16895 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | test/mjsunit/regress/regress-crbug-454091.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698