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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 508 |
509 StoreStubCompiler compiler(isolate_, strict_mode); | 509 StoreStubCompiler compiler(isolate_, strict_mode); |
510 Handle<Code> code = compiler.CompileStoreCallback(receiver, callback, name); | 510 Handle<Code> code = compiler.CompileStoreCallback(receiver, callback, name); |
511 PROFILE(isolate_, CodeCreateEvent(Logger::STORE_IC_TAG, *code, *name)); | 511 PROFILE(isolate_, CodeCreateEvent(Logger::STORE_IC_TAG, *code, *name)); |
512 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *name, *code)); | 512 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *name, *code)); |
513 JSObject::UpdateMapCodeCache(receiver, name, code); | 513 JSObject::UpdateMapCodeCache(receiver, name, code); |
514 return code; | 514 return code; |
515 } | 515 } |
516 | 516 |
517 | 517 |
| 518 Handle<Code> StubCache::ComputeStoreViaSetter(Handle<String> name, |
| 519 Handle<JSObject> receiver, |
| 520 Handle<JSFunction> setter, |
| 521 StrictModeFlag strict_mode) { |
| 522 Code::Flags flags = Code::ComputeMonomorphicFlags( |
| 523 Code::STORE_IC, CALLBACKS, strict_mode); |
| 524 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); |
| 525 if (probe->IsCode()) return Handle<Code>::cast(probe); |
| 526 |
| 527 StoreStubCompiler compiler(isolate_, strict_mode); |
| 528 Handle<Code> code = compiler.CompileStoreViaSetter(receiver, setter, name); |
| 529 PROFILE(isolate_, CodeCreateEvent(Logger::STORE_IC_TAG, *code, *name)); |
| 530 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *name, *code)); |
| 531 JSObject::UpdateMapCodeCache(receiver, name, code); |
| 532 return code; |
| 533 } |
| 534 |
| 535 |
518 Handle<Code> StubCache::ComputeStoreInterceptor(Handle<String> name, | 536 Handle<Code> StubCache::ComputeStoreInterceptor(Handle<String> name, |
519 Handle<JSObject> receiver, | 537 Handle<JSObject> receiver, |
520 StrictModeFlag strict_mode) { | 538 StrictModeFlag strict_mode) { |
521 Code::Flags flags = Code::ComputeMonomorphicFlags( | 539 Code::Flags flags = Code::ComputeMonomorphicFlags( |
522 Code::STORE_IC, INTERCEPTOR, strict_mode); | 540 Code::STORE_IC, INTERCEPTOR, strict_mode); |
523 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); | 541 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); |
524 if (probe->IsCode()) return Handle<Code>::cast(probe); | 542 if (probe->IsCode()) return Handle<Code>::cast(probe); |
525 | 543 |
526 StoreStubCompiler compiler(isolate_, strict_mode); | 544 StoreStubCompiler compiler(isolate_, strict_mode); |
527 Handle<Code> code = compiler.CompileStoreInterceptor(receiver, name); | 545 Handle<Code> code = compiler.CompileStoreInterceptor(receiver, name); |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 Handle<FunctionTemplateInfo>( | 1564 Handle<FunctionTemplateInfo>( |
1547 FunctionTemplateInfo::cast(signature->receiver())); | 1565 FunctionTemplateInfo::cast(signature->receiver())); |
1548 } | 1566 } |
1549 } | 1567 } |
1550 | 1568 |
1551 is_simple_api_call_ = true; | 1569 is_simple_api_call_ = true; |
1552 } | 1570 } |
1553 | 1571 |
1554 | 1572 |
1555 } } // namespace v8::internal | 1573 } } // namespace v8::internal |
OLD | NEW |