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

Side by Side Diff: src/contexts.h

Issue 7149019: Guard an unsafe cast of a catch context's extension object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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/contexts.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // because we frequently have to know if arbitrary objects are global 296 // because we frequently have to know if arbitrary objects are global
297 // contexts. 297 // contexts.
298 bool IsFunctionContext() { 298 bool IsFunctionContext() {
299 Map* map = this->map(); 299 Map* map = this->map();
300 return map == map->GetHeap()->function_context_map(); 300 return map == map->GetHeap()->function_context_map();
301 } 301 }
302 bool IsCatchContext() { 302 bool IsCatchContext() {
303 Map* map = this->map(); 303 Map* map = this->map();
304 return map == map->GetHeap()->catch_context_map(); 304 return map == map->GetHeap()->catch_context_map();
305 } 305 }
306 bool IsWithContext() {
307 Map* map = this->map();
308 return map == map->GetHeap()->with_context_map();
309 }
306 310
307 // Tells whether the global context is marked with out of memory. 311 // Tells whether the global context is marked with out of memory.
308 inline bool has_out_of_memory(); 312 inline bool has_out_of_memory();
309 313
310 // Mark the global context with out of memory. 314 // Mark the global context with out of memory.
311 inline void mark_out_of_memory(); 315 inline void mark_out_of_memory();
312 316
313 // The exception holder is the object used as a with object in 317 // The exception holder is the object used as a with object in
314 // the implementation of a catch block. 318 // the implementation of a catch block.
315 bool is_exception_holder(Object* object) { 319 bool is_exception_holder(Object* object) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 #ifdef DEBUG 399 #ifdef DEBUG
396 // Bootstrapping-aware type checks. 400 // Bootstrapping-aware type checks.
397 static bool IsBootstrappingOrContext(Object* object); 401 static bool IsBootstrappingOrContext(Object* object);
398 static bool IsBootstrappingOrGlobalObject(Object* object); 402 static bool IsBootstrappingOrGlobalObject(Object* object);
399 #endif 403 #endif
400 }; 404 };
401 405
402 } } // namespace v8::internal 406 } } // namespace v8::internal
403 407
404 #endif // V8_CONTEXTS_H_ 408 #endif // V8_CONTEXTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698