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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 LoadStubCompiler compiler(isolate_); | 164 LoadStubCompiler compiler(isolate_); |
| 165 Handle<Code> code = | 165 Handle<Code> code = |
| 166 compiler.CompileLoadCallback(name, receiver, holder, callback); | 166 compiler.CompileLoadCallback(name, receiver, holder, callback); |
| 167 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 167 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
| 168 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 168 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
| 169 JSObject::UpdateMapCodeCache(receiver, name, code); | 169 JSObject::UpdateMapCodeCache(receiver, name, code); |
| 170 return code; | 170 return code; |
| 171 } | 171 } |
| 172 | 172 |
| 173 | 173 |
| 174 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name, | |
| 175 Handle<JSObject> receiver, | |
| 176 Handle<JSObject> holder, | |
| 177 Handle<JSFunction> getter) { | |
| 178 ASSERT(getter->IsSpecFunction()); | |
|
Michael Starzinger
2012/06/08 07:58:33
Shouldn't that be getter->IsJSFunction() here, or
Sven Panne
2012/06/08 08:47:52
This was just a leftover of a previous weaker typi
| |
| 179 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); | |
| 180 // Note: map holder = receiver, CheckType = RECEIVER_MAP_CHECK; | |
|
Michael Starzinger
2012/06/08 07:58:33
I don't understand this comment. Can we either tur
Sven Panne
2012/06/08 08:47:52
And this was just a leftover when trying to make s
| |
| 181 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, CALLBACKS); | |
| 182 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); | |
| 183 if (probe->IsCode()) return Handle<Code>::cast(probe); | |
| 184 | |
| 185 LoadStubCompiler compiler(isolate_); | |
| 186 Handle<Code> code = | |
| 187 compiler.CompileLoadViaGetter(name, receiver, holder, getter); | |
| 188 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | |
| 189 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | |
| 190 JSObject::UpdateMapCodeCache(receiver, name, code); | |
| 191 return code; | |
| 192 } | |
| 193 | |
| 194 | |
| 174 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name, | 195 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name, |
| 175 Handle<JSObject> receiver, | 196 Handle<JSObject> receiver, |
| 176 Handle<JSObject> holder, | 197 Handle<JSObject> holder, |
| 177 Handle<JSFunction> value) { | 198 Handle<JSFunction> value) { |
| 178 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); | 199 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); |
| 179 Code::Flags flags = | 200 Code::Flags flags = |
| 180 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION); | 201 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION); |
| 181 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); | 202 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); |
| 182 if (probe->IsCode()) return Handle<Code>::cast(probe); | 203 if (probe->IsCode()) return Handle<Code>::cast(probe); |
| 183 | 204 |
| (...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1525 Handle<FunctionTemplateInfo>( | 1546 Handle<FunctionTemplateInfo>( |
| 1526 FunctionTemplateInfo::cast(signature->receiver())); | 1547 FunctionTemplateInfo::cast(signature->receiver())); |
| 1527 } | 1548 } |
| 1528 } | 1549 } |
| 1529 | 1550 |
| 1530 is_simple_api_call_ = true; | 1551 is_simple_api_call_ = true; |
| 1531 } | 1552 } |
| 1532 | 1553 |
| 1533 | 1554 |
| 1534 } } // namespace v8::internal | 1555 } } // namespace v8::internal |
| OLD | NEW |