| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 KeyedLoadStubCompiler compiler(isolate_); | 341 KeyedLoadStubCompiler compiler(isolate_); |
| 342 Handle<Code> code = | 342 Handle<Code> code = |
| 343 compiler.CompileLoadCallback(name, receiver, holder, callback); | 343 compiler.CompileLoadCallback(name, receiver, holder, callback); |
| 344 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); | 344 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); |
| 345 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); | 345 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); |
| 346 JSObject::UpdateMapCodeCache(receiver, name, code); | 346 JSObject::UpdateMapCodeCache(receiver, name, code); |
| 347 return code; | 347 return code; |
| 348 } | 348 } |
| 349 | 349 |
| 350 | 350 |
| 351 Handle<Code> StubCache::ComputeKeyedLoadArrayLength(Handle<String> name, | |
| 352 Handle<JSArray> receiver) { | |
| 353 Code::Flags flags = | |
| 354 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS); | |
| 355 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags), | |
| 356 isolate_); | |
| 357 if (probe->IsCode()) return Handle<Code>::cast(probe); | |
| 358 | |
| 359 KeyedLoadStubCompiler compiler(isolate_); | |
| 360 Handle<Code> code = compiler.CompileLoadArrayLength(name); | |
| 361 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); | |
| 362 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); | |
| 363 JSObject::UpdateMapCodeCache(receiver, name, code); | |
| 364 return code; | |
| 365 } | |
| 366 | |
| 367 | |
| 368 Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype( | 351 Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype( |
| 369 Handle<String> name, | 352 Handle<String> name, |
| 370 Handle<JSFunction> receiver) { | 353 Handle<JSFunction> receiver) { |
| 371 Code::Flags flags = | 354 Code::Flags flags = |
| 372 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS); | 355 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS); |
| 373 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags), | 356 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags), |
| 374 isolate_); | 357 isolate_); |
| 375 if (probe->IsCode()) return Handle<Code>::cast(probe); | 358 if (probe->IsCode()) return Handle<Code>::cast(probe); |
| 376 | 359 |
| 377 KeyedLoadStubCompiler compiler(isolate_); | 360 KeyedLoadStubCompiler compiler(isolate_); |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1586 Handle<FunctionTemplateInfo>( | 1569 Handle<FunctionTemplateInfo>( |
| 1587 FunctionTemplateInfo::cast(signature->receiver())); | 1570 FunctionTemplateInfo::cast(signature->receiver())); |
| 1588 } | 1571 } |
| 1589 } | 1572 } |
| 1590 | 1573 |
| 1591 is_simple_api_call_ = true; | 1574 is_simple_api_call_ = true; |
| 1592 } | 1575 } |
| 1593 | 1576 |
| 1594 | 1577 |
| 1595 } } // namespace v8::internal | 1578 } } // namespace v8::internal |
| OLD | NEW |