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

Side by Side Diff: src/api-natives.cc

Issue 1431443003: Refactor Object::SetSuperProperty and others. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Revert unintended change to test262 status file. Created 5 years, 1 month 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 | « no previous file | src/ic/ic.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/api-natives.h" 5 #include "src/api-natives.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it); 95 Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it);
96 DCHECK(maybe.IsJust()); 96 DCHECK(maybe.IsJust());
97 if (it.IsFound()) { 97 if (it.IsFound()) {
98 THROW_NEW_ERROR( 98 THROW_NEW_ERROR(
99 isolate, 99 isolate,
100 NewTypeError(MessageTemplate::kDuplicateTemplateProperty, name), 100 NewTypeError(MessageTemplate::kDuplicateTemplateProperty, name),
101 Object); 101 Object);
102 } 102 }
103 #endif 103 #endif
104 104
105 return Object::AddDataProperty(&it, value, attributes, STRICT, 105 MAYBE_RETURN_NULL(
106 Object::CERTAINLY_NOT_STORE_FROM_KEYED); 106 Object::AddDataProperty(&it, value, attributes, Object::THROW_ON_ERROR,
107 Object::CERTAINLY_NOT_STORE_FROM_KEYED));
108 return value;
107 } 109 }
108 110
109 111
110 void DisableAccessChecks(Isolate* isolate, Handle<JSObject> object) { 112 void DisableAccessChecks(Isolate* isolate, Handle<JSObject> object) {
111 Handle<Map> old_map(object->map()); 113 Handle<Map> old_map(object->map());
112 // Copy map so it won't interfere constructor's initial map. 114 // Copy map so it won't interfere constructor's initial map.
113 Handle<Map> new_map = Map::Copy(old_map, "DisableAccessChecks"); 115 Handle<Map> new_map = Map::Copy(old_map, "DisableAccessChecks");
114 new_map->set_is_access_check_needed(false); 116 new_map->set_is_access_check_needed(false);
115 JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map); 117 JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map);
116 } 118 }
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); 632 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i)));
631 JSObject::SetAccessor(result, accessor).Assert(); 633 JSObject::SetAccessor(result, accessor).Assert();
632 } 634 }
633 635
634 DCHECK(result->shared()->IsApiFunction()); 636 DCHECK(result->shared()->IsApiFunction());
635 return result; 637 return result;
636 } 638 }
637 639
638 } // namespace internal 640 } // namespace internal
639 } // namespace v8 641 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698