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

Side by Side Diff: src/objects.cc

Issue 261583004: Object.defineProperty shouldn't be a hint that we're constructing a dictionary. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added test Created 6 years, 7 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/objects.h ('k') | src/runtime.h » ('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 "v8.h" 5 #include "v8.h"
6 6
7 #include "accessors.h" 7 #include "accessors.h"
8 #include "allocation-site-scopes.h" 8 #include "allocation-site-scopes.h"
9 #include "api.h" 9 #include "api.h"
10 #include "arguments.h" 10 #include "arguments.h"
(...skipping 4300 matching lines...) Expand 10 before | Expand all | Expand 10 after
4311 // Note that this method cannot be used to set the prototype of a function 4311 // Note that this method cannot be used to set the prototype of a function
4312 // because ConvertDescriptorToField() which is called in "case CALLBACKS:" 4312 // because ConvertDescriptorToField() which is called in "case CALLBACKS:"
4313 // doesn't handle function prototypes correctly. 4313 // doesn't handle function prototypes correctly.
4314 MaybeHandle<Object> JSObject::SetLocalPropertyIgnoreAttributes( 4314 MaybeHandle<Object> JSObject::SetLocalPropertyIgnoreAttributes(
4315 Handle<JSObject> object, 4315 Handle<JSObject> object,
4316 Handle<Name> name, 4316 Handle<Name> name,
4317 Handle<Object> value, 4317 Handle<Object> value,
4318 PropertyAttributes attributes, 4318 PropertyAttributes attributes,
4319 ValueType value_type, 4319 ValueType value_type,
4320 StoreMode mode, 4320 StoreMode mode,
4321 ExtensibilityCheck extensibility_check) { 4321 ExtensibilityCheck extensibility_check,
4322 StoreFromKeyed store_from_keyed) {
4322 Isolate* isolate = object->GetIsolate(); 4323 Isolate* isolate = object->GetIsolate();
4323 4324
4324 // Make sure that the top context does not change when doing callbacks or 4325 // Make sure that the top context does not change when doing callbacks or
4325 // interceptor calls. 4326 // interceptor calls.
4326 AssertNoContextChange ncc(isolate); 4327 AssertNoContextChange ncc(isolate);
4327 4328
4328 LookupResult lookup(isolate); 4329 LookupResult lookup(isolate);
4329 object->LocalLookup(name, &lookup, true); 4330 object->LocalLookup(name, &lookup, true);
4330 if (!lookup.IsFound()) { 4331 if (!lookup.IsFound()) {
4331 object->map()->LookupTransition(*object, *name, &lookup); 4332 object->map()->LookupTransition(*object, *name, &lookup);
(...skipping 20 matching lines...) Expand all
4352 object->LocalLookupRealNamedProperty(name, &lookup); 4353 object->LocalLookupRealNamedProperty(name, &lookup);
4353 } 4354 }
4354 4355
4355 // Check for accessor in prototype chain removed here in clone. 4356 // Check for accessor in prototype chain removed here in clone.
4356 if (!lookup.IsFound()) { 4357 if (!lookup.IsFound()) {
4357 object->map()->LookupTransition(*object, *name, &lookup); 4358 object->map()->LookupTransition(*object, *name, &lookup);
4358 TransitionFlag flag = lookup.IsFound() 4359 TransitionFlag flag = lookup.IsFound()
4359 ? OMIT_TRANSITION : INSERT_TRANSITION; 4360 ? OMIT_TRANSITION : INSERT_TRANSITION;
4360 // Neither properties nor transitions found. 4361 // Neither properties nor transitions found.
4361 return AddProperty(object, name, value, attributes, SLOPPY, 4362 return AddProperty(object, name, value, attributes, SLOPPY,
4362 MAY_BE_STORE_FROM_KEYED, extensibility_check, value_type, mode, flag); 4363 store_from_keyed, extensibility_check, value_type, mode, flag);
4363 } 4364 }
4364 4365
4365 Handle<Object> old_value = isolate->factory()->the_hole_value(); 4366 Handle<Object> old_value = isolate->factory()->the_hole_value();
4366 PropertyAttributes old_attributes = ABSENT; 4367 PropertyAttributes old_attributes = ABSENT;
4367 bool is_observed = object->map()->is_observed() && 4368 bool is_observed = object->map()->is_observed() &&
4368 *name != isolate->heap()->hidden_string(); 4369 *name != isolate->heap()->hidden_string();
4369 if (is_observed && lookup.IsProperty()) { 4370 if (is_observed && lookup.IsProperty()) {
4370 if (lookup.IsDataProperty()) { 4371 if (lookup.IsDataProperty()) {
4371 old_value = Object::GetPropertyOrElement(object, name).ToHandleChecked(); 4372 old_value = Object::GetPropertyOrElement(object, name).ToHandleChecked();
4372 } 4373 }
(...skipping 12844 matching lines...) Expand 10 before | Expand all | Expand 10 after
17217 #define ERROR_MESSAGES_TEXTS(C, T) T, 17218 #define ERROR_MESSAGES_TEXTS(C, T) T,
17218 static const char* error_messages_[] = { 17219 static const char* error_messages_[] = {
17219 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17220 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17220 }; 17221 };
17221 #undef ERROR_MESSAGES_TEXTS 17222 #undef ERROR_MESSAGES_TEXTS
17222 return error_messages_[reason]; 17223 return error_messages_[reason];
17223 } 17224 }
17224 17225
17225 17226
17226 } } // namespace v8::internal 17227 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698