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

Side by Side Diff: src/isolate.cc

Issue 11877027: Add some runtime checks to MayNamedAccess (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 if (key == heap_.hidden_symbol()) return true; 917 if (key == heap_.hidden_symbol()) return true;
918 918
919 // Check for compatibility between the security tokens in the 919 // Check for compatibility between the security tokens in the
920 // current lexical context and the accessed object. 920 // current lexical context and the accessed object.
921 ASSERT(context()); 921 ASSERT(context());
922 922
923 MayAccessDecision decision = MayAccessPreCheck(this, receiver, type); 923 MayAccessDecision decision = MayAccessPreCheck(this, receiver, type);
924 if (decision != UNKNOWN) return decision == YES; 924 if (decision != UNKNOWN) return decision == YES;
925 925
926 // Get named access check callback 926 // Get named access check callback
927 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); 927 // TODO(dcarney): revert
928 Map* map = receiver->map();
929 CHECK(map->IsMap());
930 CHECK(map->constructor()->IsJSFunction());
931 JSFunction* constructor = JSFunction::cast(map->constructor());
928 if (!constructor->shared()->IsApiFunction()) return false; 932 if (!constructor->shared()->IsApiFunction()) return false;
929 933
930 Object* data_obj = 934 Object* data_obj =
931 constructor->shared()->get_api_func_data()->access_check_info(); 935 constructor->shared()->get_api_func_data()->access_check_info();
932 if (data_obj == heap_.undefined_value()) return false; 936 if (data_obj == heap_.undefined_value()) return false;
933 937
934 Object* fun_obj = AccessCheckInfo::cast(data_obj)->named_callback(); 938 Object* fun_obj = AccessCheckInfo::cast(data_obj)->named_callback();
935 v8::NamedSecurityCallback callback = 939 v8::NamedSecurityCallback callback =
936 v8::ToCData<v8::NamedSecurityCallback>(fun_obj); 940 v8::ToCData<v8::NamedSecurityCallback>(fun_obj);
937 941
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
2212 2216
2213 #ifdef DEBUG 2217 #ifdef DEBUG
2214 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2218 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2215 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2219 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2216 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2220 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2217 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2221 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2218 #undef ISOLATE_FIELD_OFFSET 2222 #undef ISOLATE_FIELD_OFFSET
2219 #endif 2223 #endif
2220 2224
2221 } } // namespace v8::internal 2225 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698