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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 InlineCacheHolderFlag IC::GetCodeCacheForObject(Object* object) { | 150 InlineCacheHolderFlag IC::GetCodeCacheForObject(Object* object) { |
| 151 if (object->IsJSObject()) return OWN_MAP; | 151 if (object->IsJSObject()) return OWN_MAP; |
| 152 | 152 |
| 153 // If the object is a value, we use the prototype map for the cache. | 153 // If the object is a value, we use the prototype map for the cache. |
| 154 ASSERT(object->IsString() || object->IsSymbol() || | 154 ASSERT(object->IsString() || object->IsSymbol() || |
| 155 object->IsNumber() || object->IsBoolean()); | 155 object->IsNumber() || object->IsBoolean()); |
| 156 return PROTOTYPE_MAP; | 156 return PROTOTYPE_MAP; |
| 157 } | 157 } |
| 158 | 158 |
| 159 | 159 |
| 160 HeapObject* IC::GetCodeCacheHolder(Isolate* isolate, | 160 Handle<HeapObject> IC::GetCodeCacheHolder(Isolate* isolate, |
| 161 Object* object, | 161 Handle<Object> object, |
| 162 InlineCacheHolderFlag holder) { | 162 InlineCacheHolderFlag holder) { |
|
Yang
2014/04/15 13:10:48
No need to handlify.
| |
| 163 if (object->IsSmi()) holder = PROTOTYPE_MAP; | 163 if (object->IsSmi()) holder = PROTOTYPE_MAP; |
| 164 Object* map_owner = holder == OWN_MAP | 164 Handle<Object> map_owner = holder == OWN_MAP |
| 165 ? object : object->GetPrototype(isolate); | 165 ? object : Object::GetPrototype(isolate, object); |
| 166 return HeapObject::cast(map_owner); | 166 return handle(HeapObject::cast(*map_owner)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 | 169 |
| 170 InlineCacheHolderFlag IC::GetCodeCacheFlag(HeapType* type) { | 170 InlineCacheHolderFlag IC::GetCodeCacheFlag(HeapType* type) { |
| 171 if (type->Is(HeapType::Boolean()) || | 171 if (type->Is(HeapType::Boolean()) || |
| 172 type->Is(HeapType::Number()) || | 172 type->Is(HeapType::Number()) || |
| 173 type->Is(HeapType::String()) || | 173 type->Is(HeapType::String()) || |
| 174 type->Is(HeapType::Symbol())) { | 174 type->Is(HeapType::Symbol())) { |
| 175 return PROTOTYPE_MAP; | 175 return PROTOTYPE_MAP; |
| 176 } | 176 } |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 196 } | 196 } |
| 197 return handle(JSObject::cast(constructor->instance_prototype())->map()); | 197 return handle(JSObject::cast(constructor->instance_prototype())->map()); |
| 198 } | 198 } |
| 199 return TypeToMap(type, isolate); | 199 return TypeToMap(type, isolate); |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| 203 } } // namespace v8::internal | 203 } } // namespace v8::internal |
| 204 | 204 |
| 205 #endif // V8_IC_INL_H_ | 205 #endif // V8_IC_INL_H_ |
| OLD | NEW |