OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 JSFunction* fun = JSFunction::cast(f); | 413 JSFunction* fun = JSFunction::cast(f); |
414 Object* perhaps_context = fun->unchecked_context(); | 414 Object* perhaps_context = fun->unchecked_context(); |
415 if (perhaps_context->IsHeapObject() && | 415 if (perhaps_context->IsHeapObject() && |
416 Heap::Contains(HeapObject::cast(perhaps_context)) && | 416 Heap::Contains(HeapObject::cast(perhaps_context)) && |
417 perhaps_context->IsContext()) { | 417 perhaps_context->IsContext()) { |
418 Context* context = fun->context(); | 418 Context* context = fun->context(); |
419 if (!Heap::Contains(context)) { | 419 if (!Heap::Contains(context)) { |
420 Add("(Function context is outside heap)\n"); | 420 Add("(Function context is outside heap)\n"); |
421 return; | 421 return; |
422 } | 422 } |
423 GlobalObject* global = context->global(); | 423 Object* token = context->global_context()->security_token(); |
424 if (!Heap::Contains(global)) { | 424 if (token != current_security_token) { |
425 Add("(Function context global is outside heap)\n"); | 425 Add("Security context: %o\n", token); |
426 return; | 426 current_security_token = token; |
427 } | |
428 if (global->IsJSGlobalObject()) { | |
429 Object* token = JSGlobalObject::cast(global)->security_token(); | |
430 if (token != current_security_token) { | |
431 Add("Security context: %o\n", token); | |
432 current_security_token = token; | |
433 } | |
434 } else { | |
435 Add("(No security context)\n"); | |
436 } | 427 } |
437 } else { | 428 } else { |
438 Add("(Function context is corrupt)\n"); | 429 Add("(Function context is corrupt)\n"); |
439 } | 430 } |
440 } | 431 } |
441 | 432 |
442 | 433 |
443 void StringStream::PrintFunction(Object* f, Object* receiver, Code** code) { | 434 void StringStream::PrintFunction(Object* f, Object* receiver, Code** code) { |
444 if (f->IsHeapObject() && | 435 if (f->IsHeapObject() && |
445 Heap::Contains(HeapObject::cast(f)) && | 436 Heap::Contains(HeapObject::cast(f)) && |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 unsigned new_bytes = *bytes * 2; | 532 unsigned new_bytes = *bytes * 2; |
542 if (new_bytes > size_) { | 533 if (new_bytes > size_) { |
543 new_bytes = size_; | 534 new_bytes = size_; |
544 } | 535 } |
545 *bytes = new_bytes; | 536 *bytes = new_bytes; |
546 return space_; | 537 return space_; |
547 } | 538 } |
548 | 539 |
549 | 540 |
550 } } // namespace v8::internal | 541 } } // namespace v8::internal |
OLD | NEW |