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

Side by Side Diff: src/runtime/runtime-scopes.cc

Issue 1643563002: [runtime] further dismantle AccessorInfoHandling, reducing it to the single API usecase. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 if (old_details.IsReadOnly() || old_details.IsDontEnum() || 71 if (old_details.IsReadOnly() || old_details.IsDontEnum() ||
72 old_details.type() == ACCESSOR_CONSTANT) { 72 old_details.type() == ACCESSOR_CONSTANT) {
73 return ThrowRedeclarationError(isolate, name); 73 return ThrowRedeclarationError(isolate, name);
74 } 74 }
75 // If the existing property is not configurable, keep its attributes. Do 75 // If the existing property is not configurable, keep its attributes. Do
76 attr = old_attributes; 76 attr = old_attributes;
77 } 77 }
78 } 78 }
79 79
80 // Define or redefine own property. 80 // Define or redefine own property.
81 RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::SetOwnPropertyIgnoreAttributes( 81 RETURN_FAILURE_ON_EXCEPTION(
82 global, name, value, attr)); 82 isolate, JSObject::DefineOwnPropertyIgnoreAttributes(&it, value, attr));
83 83
84 return isolate->heap()->undefined_value(); 84 return isolate->heap()->undefined_value();
85 } 85 }
86 86
87 87
88 RUNTIME_FUNCTION(Runtime_DeclareGlobals) { 88 RUNTIME_FUNCTION(Runtime_DeclareGlobals) {
89 HandleScope scope(isolate); 89 HandleScope scope(isolate);
90 DCHECK_EQ(2, args.length()); 90 DCHECK_EQ(2, args.length());
91 Handle<JSGlobalObject> global(isolate->global_object()); 91 Handle<JSGlobalObject> global(isolate->global_object());
92 Handle<Context> context(isolate->context()); 92 Handle<Context> context(isolate->context());
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // Ignore if we can't reconfigure the value. 189 // Ignore if we can't reconfigure the value.
190 if ((old_attributes & DONT_DELETE) != 0) { 190 if ((old_attributes & DONT_DELETE) != 0) {
191 if ((old_attributes & READ_ONLY) != 0 || 191 if ((old_attributes & READ_ONLY) != 0 ||
192 it.state() == LookupIterator::ACCESSOR) { 192 it.state() == LookupIterator::ACCESSOR) {
193 return *value; 193 return *value;
194 } 194 }
195 attr = static_cast<PropertyAttributes>(old_attributes | READ_ONLY); 195 attr = static_cast<PropertyAttributes>(old_attributes | READ_ONLY);
196 } 196 }
197 } 197 }
198 198
199 RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::SetOwnPropertyIgnoreAttributes( 199 RETURN_FAILURE_ON_EXCEPTION(
200 global, name, value, attr)); 200 isolate, JSObject::DefineOwnPropertyIgnoreAttributes(&it, value, attr));
201 201
202 return *value; 202 return *value;
203 } 203 }
204 204
205 205
206 namespace { 206 namespace {
207 207
208 Object* DeclareLookupSlot(Isolate* isolate, Handle<String> name, 208 Object* DeclareLookupSlot(Isolate* isolate, Handle<String> name,
209 Handle<Object> initial_value, 209 Handle<Object> initial_value,
210 PropertyAttributes attr) { 210 PropertyAttributes attr) {
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 1248
1249 // Lookup in the initial Object.prototype object. 1249 // Lookup in the initial Object.prototype object.
1250 Handle<Object> result; 1250 Handle<Object> result;
1251 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1251 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1252 isolate, result, 1252 isolate, result,
1253 Object::GetProperty(isolate->initial_object_prototype(), key)); 1253 Object::GetProperty(isolate->initial_object_prototype(), key));
1254 return *result; 1254 return *result;
1255 } 1255 }
1256 } // namespace internal 1256 } // namespace internal
1257 } // namespace v8 1257 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698