Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 11980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11991 | 11991 |
| 11992 MaybeObject* CompilationCacheTable::Put(String* src, | 11992 MaybeObject* CompilationCacheTable::Put(String* src, |
| 11993 Context* context, | 11993 Context* context, |
| 11994 Object* value) { | 11994 Object* value) { |
| 11995 SharedFunctionInfo* shared = context->closure()->shared(); | 11995 SharedFunctionInfo* shared = context->closure()->shared(); |
| 11996 StringSharedKey key(src, | 11996 StringSharedKey key(src, |
| 11997 shared, | 11997 shared, |
| 11998 CurrentGlobalLanguageMode(), | 11998 CurrentGlobalLanguageMode(), |
| 11999 RelocInfo::kNoPosition); | 11999 RelocInfo::kNoPosition); |
| 12000 Object* obj; | 12000 Object* obj; |
| 12001 { MaybeObject* maybe_obj = EnsureCapacity(1, &key); | 12001 MaybeObject* maybe_obj = EnsureCapacity(1, &key); |
| 12002 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 12002 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
| 12003 } | |
| 12004 | 12003 |
| 12005 CompilationCacheTable* cache = | 12004 CompilationCacheTable* cache = |
| 12006 reinterpret_cast<CompilationCacheTable*>(obj); | 12005 reinterpret_cast<CompilationCacheTable*>(obj); |
|
Sven Panne
2012/08/28 07:35:00
Do we really need the reinterpret_cast here or wou
rossberg
2012/08/28 11:09:39
Indeed, it's not needed. Changed.
| |
| 12007 int entry = cache->FindInsertionEntry(key.Hash()); | 12006 int entry = cache->FindInsertionEntry(key.Hash()); |
| 12008 | 12007 |
| 12009 Object* k; | 12008 Object* k; |
| 12010 { MaybeObject* maybe_k = key.AsObject(); | 12009 MaybeObject* maybe_k = key.AsObject(); |
| 12011 if (!maybe_k->ToObject(&k)) return maybe_k; | 12010 if (!maybe_k->ToObject(&k)) return maybe_k; |
| 12012 } | |
| 12013 | 12011 |
| 12014 cache->set(EntryToIndex(entry), k); | 12012 cache->set(EntryToIndex(entry), k); |
| 12015 cache->set(EntryToIndex(entry) + 1, value); | 12013 cache->set(EntryToIndex(entry) + 1, value); |
| 12016 cache->ElementAdded(); | 12014 cache->ElementAdded(); |
| 12017 return cache; | 12015 return cache; |
| 12018 } | 12016 } |
| 12019 | 12017 |
| 12020 | 12018 |
| 12021 MaybeObject* CompilationCacheTable::PutEval(String* src, | 12019 MaybeObject* CompilationCacheTable::PutEval(String* src, |
| 12022 Context* context, | 12020 Context* context, |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13170 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13168 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
| 13171 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13169 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
| 13172 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13170 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
| 13173 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13171 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
| 13174 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13172 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
| 13175 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13173 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
| 13176 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13174 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
| 13177 } | 13175 } |
| 13178 | 13176 |
| 13179 } } // namespace v8::internal | 13177 } } // namespace v8::internal |
| OLD | NEW |