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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 // Compute check type based on receiver/holder. | 571 // Compute check type based on receiver/holder. |
572 CheckType check = RECEIVER_MAP_CHECK; | 572 CheckType check = RECEIVER_MAP_CHECK; |
573 if (object->IsString()) { | 573 if (object->IsString()) { |
574 check = STRING_CHECK; | 574 check = STRING_CHECK; |
575 } else if (object->IsNumber()) { | 575 } else if (object->IsNumber()) { |
576 check = NUMBER_CHECK; | 576 check = NUMBER_CHECK; |
577 } else if (object->IsBoolean()) { | 577 } else if (object->IsBoolean()) { |
578 check = BOOLEAN_CHECK; | 578 check = BOOLEAN_CHECK; |
579 } | 579 } |
580 | 580 |
| 581 if (check != RECEIVER_MAP_CHECK && |
| 582 !function->IsBuiltin() && |
| 583 function->shared()->is_classic_mode()) { |
| 584 // Calling non-strict non-builtins with a value as the receiver |
| 585 // requires boxing. |
| 586 return Handle<Code>::null(); |
| 587 } |
| 588 |
581 Code::Flags flags = | 589 Code::Flags flags = |
582 Code::ComputeMonomorphicFlags(kind, Code::CONSTANT_FUNCTION, extra_state, | 590 Code::ComputeMonomorphicFlags(kind, Code::CONSTANT_FUNCTION, extra_state, |
583 cache_holder, argc); | 591 cache_holder, argc); |
584 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 592 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
585 isolate_); | 593 isolate_); |
586 if (probe->IsCode()) return Handle<Code>::cast(probe); | 594 if (probe->IsCode()) return Handle<Code>::cast(probe); |
587 | 595 |
588 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); | 596 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); |
589 Handle<Code> code = | 597 Handle<Code> code = |
590 compiler.CompileCallConstant(object, holder, function, name, check); | 598 compiler.CompileCallConstant(object, holder, name, check, function); |
591 code->set_check_type(check); | 599 code->set_check_type(check); |
592 ASSERT_EQ(flags, code->flags()); | 600 ASSERT_EQ(flags, code->flags()); |
593 PROFILE(isolate_, | 601 PROFILE(isolate_, |
594 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); | 602 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); |
595 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); | 603 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); |
596 JSObject::UpdateMapCodeCache(map_holder, name, code); | 604 JSObject::UpdateMapCodeCache(map_holder, name, code); |
597 return code; | 605 return code; |
598 } | 606 } |
599 | 607 |
600 | 608 |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 Handle<FunctionTemplateInfo>( | 1762 Handle<FunctionTemplateInfo>( |
1755 FunctionTemplateInfo::cast(signature->receiver())); | 1763 FunctionTemplateInfo::cast(signature->receiver())); |
1756 } | 1764 } |
1757 } | 1765 } |
1758 | 1766 |
1759 is_simple_api_call_ = true; | 1767 is_simple_api_call_ = true; |
1760 } | 1768 } |
1761 | 1769 |
1762 | 1770 |
1763 } } // namespace v8::internal | 1771 } } // namespace v8::internal |
OLD | NEW |