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

Side by Side Diff: src/objects.cc

Issue 368783006: Treat ExecutableAccessorInfo as regular data properties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/ic.cc ('k') | test/cctest/test-api.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 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after
3073 case INTERCEPTOR: { 3073 case INTERCEPTOR: {
3074 LookupIterator it(object, name, handle(result.holder())); 3074 LookupIterator it(object, name, handle(result.holder()));
3075 PropertyAttributes attr = GetPropertyAttributes(&it); 3075 PropertyAttributes attr = GetPropertyAttributes(&it);
3076 *done = !!(attr & READ_ONLY); 3076 *done = !!(attr & READ_ONLY);
3077 break; 3077 break;
3078 } 3078 }
3079 case CALLBACKS: { 3079 case CALLBACKS: {
3080 *done = true; 3080 *done = true;
3081 if (!result.IsReadOnly()) { 3081 if (!result.IsReadOnly()) {
3082 Handle<Object> callback_object(result.GetCallbackObject(), isolate); 3082 Handle<Object> callback_object(result.GetCallbackObject(), isolate);
3083 // Only store via executable access info setters if the holder is the
3084 // receiver or on its hidden prototype chain.
3085 if (callback_object->IsExecutableAccessorInfo()) {
3086 Handle<JSObject> current = object;
3087 while (*current != result.holder()) {
3088 // There is a callbacks holder, so we are guaranteed that all
3089 // objects in between are JSObjects.
3090 Handle<JSObject> prototype(
3091 JSObject::cast(current->GetPrototype()));
3092 if (!current->IsJSGlobalProxy() &&
3093 !prototype->map()->is_hidden_prototype()) {
3094 *done = result.IsReadOnly();
mvstanton 2014/07/03 09:33:08 How about *done = false, because result.IsReadOnly
3095 break;
3096 }
3097 current = prototype;
3098 }
3099 if (*current != result.holder()) break;
mvstanton 2014/07/03 09:33:08 comment to explain this break.
3100 }
3083 return SetPropertyWithCallback(object, name, value, 3101 return SetPropertyWithCallback(object, name, value,
3084 handle(result.holder()), 3102 handle(result.holder()),
3085 callback_object, strict_mode); 3103 callback_object, strict_mode);
3086 } 3104 }
3087 break; 3105 break;
3088 } 3106 }
3089 case HANDLER: { 3107 case HANDLER: {
3090 Handle<JSProxy> proxy(result.proxy()); 3108 Handle<JSProxy> proxy(result.proxy());
3091 return JSProxy::SetPropertyViaPrototypesWithHandler( 3109 return JSProxy::SetPropertyViaPrototypesWithHandler(
3092 proxy, object, name, value, attributes, strict_mode, done); 3110 proxy, object, name, value, attributes, strict_mode, done);
(...skipping 13876 matching lines...) Expand 10 before | Expand all | Expand 10 after
16969 #define ERROR_MESSAGES_TEXTS(C, T) T, 16987 #define ERROR_MESSAGES_TEXTS(C, T) T,
16970 static const char* error_messages_[] = { 16988 static const char* error_messages_[] = {
16971 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16989 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16972 }; 16990 };
16973 #undef ERROR_MESSAGES_TEXTS 16991 #undef ERROR_MESSAGES_TEXTS
16974 return error_messages_[reason]; 16992 return error_messages_[reason];
16975 } 16993 }
16976 16994
16977 16995
16978 } } // namespace v8::internal 16996 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698