説明を見る。00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "v8.h"
00029
00030 namespace v8 { namespace internal {
00031
00032
00033 void DescriptorWriter::Write(Descriptor* desc) {
00034 ASSERT(desc->key_->IsSymbol());
00035 descriptors_->Set(pos_, desc);
00036 advance();
00037 }
00038
00039
00040 void DescriptorWriter::WriteFrom(DescriptorReader* reader) {
00041 Descriptor desc;
00042 reader->Get(&desc);
00043 Write(&desc);
00044 }
00045
00046
00047 #ifdef DEBUG
00048 void LookupResult::Print() {
00049 if (!IsValid()) {
00050 PrintF("Not Found\n");
00051 return;
00052 }
00053
00054 PrintF("LookupResult:\n");
00055 PrintF(" -cacheable = %s\n", IsCacheable() ? "true" : "false");
00056 PrintF(" -attributes = %x\n", GetAttributes());
00057 switch (type()) {
00058 case NORMAL:
00059 PrintF(" -type = normal\n");
00060 PrintF(" -entry = %d", GetDictionaryEntry());
00061 break;
00062 case MAP_TRANSITION:
00063 PrintF(" -type = map transition\n");
00064 PrintF(" -map:\n");
00065 GetTransitionMap()->Print();
00066 PrintF("\n");
00067 break;
00068 case CONSTANT_FUNCTION:
00069 PrintF(" -type = constant function\n");
00070 PrintF(" -function:\n");
00071 GetConstantFunction()->Print();
00072 PrintF("\n");
00073 break;
00074 case FIELD:
00075 PrintF(" -type = field\n");
00076 PrintF(" -index = %d", GetFieldIndex());
00077 PrintF("\n");
00078 break;
00079 case CALLBACKS:
00080 PrintF(" -type = call backs\n");
00081 PrintF(" -callback object:\n");
00082 GetCallbackObject()->Print();
00083 break;
00084 case INTERCEPTOR:
00085 PrintF(" -type = lookup interceptor\n");
00086 break;
00087 case CONSTANT_TRANSITION:
00088 PrintF(" -type = constant property transition\n");
00089 break;
00090 case NULL_DESCRIPTOR:
00091 PrintF(" =type = null descriptor\n");
00092 break;
00093 }
00094 }
00095
00096
00097 void Descriptor::Print() {
00098 PrintF("Descriptor ");
00099 GetKey()->ShortPrint();
00100 PrintF(" @ ");
00101 GetValue()->ShortPrint();
00102 PrintF(" %d\n", GetDetails().index());
00103 }
00104
00105
00106 #endif
00107
00108
00109 } }