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

Side by Side Diff: src/objects-inl.h

Issue 13285: Refactor the convertion of a target address into a code object from the debug... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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') | test/cctest/test-debug.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 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 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 return (flags & kFlagsArgumentsCountMask) >> kFlagsArgumentsCountShift; 1870 return (flags & kFlagsArgumentsCountMask) >> kFlagsArgumentsCountShift;
1871 } 1871 }
1872 1872
1873 1873
1874 Code::Flags Code::RemoveTypeFromFlags(Flags flags) { 1874 Code::Flags Code::RemoveTypeFromFlags(Flags flags) {
1875 int bits = flags & ~kFlagsTypeMask; 1875 int bits = flags & ~kFlagsTypeMask;
1876 return static_cast<Flags>(bits); 1876 return static_cast<Flags>(bits);
1877 } 1877 }
1878 1878
1879 1879
1880 Code* Code::GetCodeFromTargetAddress(Address address) {
1881 HeapObject* code = HeapObject::FromAddress(address - Code::kHeaderSize);
1882 // GetCodeFromTargetAddress might be called when marking objects during mark
1883 // sweep. reinterpret_cast is therefore used instead of the more appropriate
1884 // Code::cast. Code::cast does not work when the object's map is
1885 // marked.
1886 Code* result = reinterpret_cast<Code*>(code);
1887 return result;
1888 }
1889
1890
1880 Object* Map::prototype() { 1891 Object* Map::prototype() {
1881 return READ_FIELD(this, kPrototypeOffset); 1892 return READ_FIELD(this, kPrototypeOffset);
1882 } 1893 }
1883 1894
1884 1895
1885 void Map::set_prototype(Object* value, WriteBarrierMode mode) { 1896 void Map::set_prototype(Object* value, WriteBarrierMode mode) {
1886 ASSERT(value->IsNull() || value->IsJSObject()); 1897 ASSERT(value->IsNull() || value->IsJSObject());
1887 WRITE_FIELD(this, kPrototypeOffset, value); 1898 WRITE_FIELD(this, kPrototypeOffset, value);
1888 CONDITIONAL_WRITE_BARRIER(this, kPrototypeOffset, mode); 1899 CONDITIONAL_WRITE_BARRIER(this, kPrototypeOffset, mode);
1889 } 1900 }
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 #undef WRITE_INT_FIELD 2479 #undef WRITE_INT_FIELD
2469 #undef READ_SHORT_FIELD 2480 #undef READ_SHORT_FIELD
2470 #undef WRITE_SHORT_FIELD 2481 #undef WRITE_SHORT_FIELD
2471 #undef READ_BYTE_FIELD 2482 #undef READ_BYTE_FIELD
2472 #undef WRITE_BYTE_FIELD 2483 #undef WRITE_BYTE_FIELD
2473 2484
2474 2485
2475 } } // namespace v8::internal 2486 } } // namespace v8::internal
2476 2487
2477 #endif // V8_OBJECTS_INL_H_ 2488 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698