Home | History | Annotate | Download | only in src

Lines Matching refs:Code

6 //     * Redistributions of source code must retain the above copyright
52 // computed from the original code - not the patched code. Let
53 // these cases fall through to the unreachable code below.
64 Code* new_target) {
75 Code* apply_builtin = isolate->builtins()->builtin(
85 Code::GetKeyedAccessGrowMode(new_target->extra_ic_state()) ==
114 // To improve the performance of the (much used) IC code, we unfold
115 // a few levels of the stack frame iteration code. This yields a
150 // Find the function on the stack and both the active code for the
151 // function and the original code.
154 Code* code = shared->code();
156 Code* original_code = Debug::GetDebugInfo(shared)->original_code();
158 // Get the address of the call site in the active code. This is the
162 // Return the address in the original code. This is the place where
166 original_code->instruction_start() - code->instruction_start();
192 static bool TryRemoveInvalidPrototypeDependentStub(Code* target,
196 Code::ExtractCacheHolderFromFlags(target->flags());
214 // the receiver map's code cache. Therefore, if the current target
215 // is in the receiver map's code cache, the inline cache failed due
227 IC::State IC::StateFrom(Code* target, Object* receiver, Object* name) {
236 Code::Kind kind = target->kind();
237 if (kind == Code::KEYED_LOAD_IC ||
238 kind == Code::KEYED_STORE_IC ||
239 kind == Code::KEYED_CALL_IC) {
243 // Remove the target from the code cache if it became invalid
248 if (kind != Code::CALL_IC &&
269 Code* code = Code::cast(isolate()->heap()->FindCodeObject(addr));
270 for (RelocIterator it(code, RelocInfo::kCodeTargetMask);
309 void IC::PostPatching(Address address, Code* target, Code* old_target) {
313 Code* host = target->GetHeap()->isolate()->
314 inner_pointer_to_code_cache()->GetCacheEntry(address)->code;
315 if (host->kind() != Code::FUNCTION) return;
322 // Not all Code objects have TypeFeedbackInfo.
341 Code* target = GetTargetAtAddress(address);
347 case Code::LOAD_IC: return LoadIC::Clear(address, target);
348 case Code::KEYED_LOAD_IC:
350 case Code::STORE_IC: return StoreIC::Clear(address, target);
351 case Code::KEYED_STORE_IC:
353 case Code::CALL_IC: return CallIC::Clear(address, target);
354 case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target);
355 case Code::UNARY_OP_IC:
356 case Code::BINARY_OP_IC:
357 case Code::COMPARE_IC:
358 case Code::TO_BOOLEAN_IC:
367 void CallICBase::Clear(Address address, Code* target) {
371 Code* code =
376 SetTargetAtAddress(address, code);
380 void KeyedLoadIC::Clear(Address address, Code* target) {
383 // do not clear these maps, cached code can keep objects alive
389 void LoadIC::Clear(Address address, Code* target) {
395 void StoreIC::Clear(Address address, Code* target) {
398 (Code::GetStrictMode(target->extra_ic_state()) == kStrictMode)
404 void KeyedStoreIC::Clear(Address address, Code* target) {
407 (Code::GetStrictMode(target->extra_ic_state()) == kStrictMode)
500 Code::ExtraICState extra_ic_state,
586 Code::ExtraICState* extra_ic_state) {
587 ASSERT(kind_ == Code::CALL_IC);
628 Handle<Code> CallICBase::ComputeMonomorphicStub(LookupResult* lookup,
630 Code::ExtraICState extra_state,
642 // Get the constant function and compute the code stub for this
644 // that the code stub is in the stub cache.
651 if (!object->IsJSObject()) return Handle<Code>::null();
657 if (!cell->value()->IsJSFunction()) return Handle<Code>::null();
666 if (!holder.is_identical_to(receiver)) return Handle<Code>::null();
677 return Handle<Code>::null();
684 Code::ExtraICState extra_ic_state,
701 Handle<Code> code;
706 code = isolate()->stub_cache()->ComputeCallPreMonomorphic(
709 if (kind_ == Code::CALL_IC &&
711 code = ComputeMonomorphicStub(lookup, state, extra_ic_state,
713 } else if (kind_ == Code::CALL_IC &&
718 code = ComputeMonomorphicStub(lookup, state, extra_ic_state,
721 code = isolate()->stub_cache()->ComputeCallMegamorphic(
725 code = ComputeMonomorphicStub(lookup, state, extra_ic_state,
730 if (code.is_null()) return;
737 set_target(*code);
739 // Cache code holding map should be consistent with
745 isolate()->stub_cache()->Set(*name, cache_object->map(), *code);
749 TRACE_IC(kind_ == Code::CALL_IC ? "CallIC" : "KeyedCallIC",
759 Code::kNoExtraICState,
774 Handle<Code> code = isolate()->stub_cache()->ComputeCallArguments(
775 argc, Code::KEYED_CALL_IC);
776 set_target(*code);
779 Handle<Code> code = isolate()->stub_cache()->ComputeCallMegamorphic(
780 argc, Code::KEYED_CALL_IC, Code::kNoExtraICState);
781 set_target(*code);
812 // Use specialized code for getting the length of strings and
818 Handle<Code> stub;
843 // Use specialized code for getting the length of arrays.
846 Handle<Code> stub;
863 // Use specialized code for getting prototype of functions.
867 Handle<Code> stub;
941 // Compute the code stub for this load.
942 Handle<Code> code;
947 code = pre_monomorphic_stub();
950 code = isolate()->stub_cache()->ComputeLoadNonexistent(name, receiver);
956 code = isolate()->stub_cache()->ComputeLoadField(
961 code = isolate()->stub_cache()->ComputeLoadConstant(
969 code = isolate()->stub_cache()->ComputeLoadGlobal(
977 code = isolate()->stub_cache()->ComputeLoadNormal();
986 code = isolate()->stub_cache()->ComputeLoadCallback(
992 code = isolate()->stub_cache()->ComputeLoadInterceptor(
1004 set_target(*code);
1013 isolate()->stub_cache()->Set(*name, receiver->map(), *code);
1017 // Cache code holding map should be consistent with
1019 isolate()->stub_cache()->Set(*name, receiver->map(), *code);
1026 Handle<Code> KeyedLoadIC::GetElementStubWithoutMapCheck(
1035 Handle<Code> KeyedLoadIC::ComputePolymorphicStub(
1042 Handle<Code> cached_stub = ComputeMonomorphicStubWithoutMapCheck(
1047 Handle<Code> code = compiler.CompileLoadPolymorphic(
1051 CodeCreateEvent(Logger::KEYED_LOAD_MEGAMORPHIC_IC_TAG, *code, 0));
1052 return code;
1061 // TODO(1295): Remove this code.
1081 // Use specialized code for getting the length of strings.
1085 Handle<Code> code =
1087 ASSERT(!code.is_null());
1088 set_target(*code);
1093 // Use specialized code for getting the length of arrays.
1097 Handle<Code> code =
1099 ASSERT(!code.is_null());
1100 set_target(*code);
1105 // Use specialized code for getting prototype of functions.
1110 Handle<Code> code =
1113 ASSERT(!code.is_null());
1114 set_target(*code);
1164 Handle<Code> stub = generic_stub();
1206 // Compute the code stub for this load.
1207 Handle<Code> code;
1213 code = pre_monomorphic_stub();
1219 code = isolate()->stub_cache()->ComputeKeyedLoadField(
1224 code = isolate()->stub_cache()->ComputeKeyedLoadConstant(
1234 code = isolate()->stub_cache()->ComputeKeyedLoadCallback(
1240 code = isolate()->stub_cache()->ComputeKeyedLoadInterceptor(
1246 code = generic_stub();
1255 set_target(*code);
1335 // Use specialized code for setting the length of arrays with fast
1345 Handle<Code> stub = (strict_mode == kStrictMode)
1376 Handle<Code> stub = (strict_mode == kStrictMode)
1408 // Compute the code stub for this store; used for rewriting to
1409 // monomorphic state and making sure that the code stub is in the
1411 Handle<Code> code;
1414 code = isolate()->stub_cache()->ComputeStoreField(name,
1424 code = isolate()->stub_cache()->ComputeStoreField(
1435 code = isolate()->stub_cache()->ComputeStoreGlobal(
1439 code = isolate()->stub_cache()->ComputeStoreNormal(strict_mode);
1448 code = isolate()->stub_cache()->ComputeStoreCallback(
1454 code = isolate()->stub_cache()->ComputeStoreInterceptor(
1469 set_target(*code);
1472 if (target() != *code) {
1479 isolate()->stub_cache()->Set(*name, receiver->map(), *code);
1500 void KeyedIC::GetReceiverMapsForStub(Handle<Code> stub,
1523 Handle<Code> KeyedIC::ComputeStub(Handle<JSObject> receiver,
1526 Handle<Code> generic_stub) {
1543 GetReceiverMapsForStub(Handle<Code>(target()), &target_receiver_maps);
1593 if ((Code::GetKeyedAccessGrowMode(target()->extra_ic_state()) ==
1600 Code::ExtraICState extra_state = Code::ComputeExtraICState(grow_mode,
1602 Code::Flags flags = Code::ComputeFlags(kind(), MEGAMORPHIC, extra_state);
1604 if (probe->IsCode()) return Handle<Code>::cast(probe);
1606 Handle<Code> stub =
1613 Handle<Code> KeyedIC::ComputeMonomorphicStubWithoutMapCheck(
1634 Handle<Code> KeyedIC::ComputeMonomorphicStub(Handle<JSObject> receiver,
1637 Handle<Code> generic_stub) {
1671 Handle<Code> KeyedStoreIC::GetElementStubWithoutMapCheck(
1679 Handle<Code> KeyedStoreIC::ComputePolymorphicStub(
1688 Handle<Code> cached_stub;
1707 Handle<Code> code = compiler.CompileStorePolymorphic(
1711 CodeCreateEvent(Logger::KEYED_STORE_MEGAMORPHIC_IC_TAG, *code, 0));
1712 return code;
1810 Handle<Code> stub = (strict_mode == kStrictMode)
1856 // Compute the code stub for this store; used for rewriting to
1857 // monomorphic state and making sure that the code stub is in the
1859 Handle<Code> code;
1863 code = isolate()->stub_cache()->ComputeKeyedStoreField(
1871 code = isolate()->stub_cache()->ComputeKeyedStoreField(
1884 code = (strict_mode == kStrictMode)
1894 ASSERT(!code.is_null());
1900 set_target(*code);
1924 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2001 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2003 Code::GetStrictMode(extra_ic_state),
2017 // The generated code should filter out non-Smis before we get here.
2077 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2079 Code::GetStrictMode(extra_ic_state),
2091 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2095 StrictModeFlag strict_mode = Code::GetStrictMode(extra_ic_state);
2110 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2112 Code::GetStrictMode(extra_ic_state),
2120 void UnaryOpIC::patch(Code* code) {
2121 set_target(code);
2185 void BinaryOpIC::patch(Code* code) {
2186 set_target(code);
2290 Handle<Code> code = stub.GetCode();
2291 if (!code.is_null()) {
2299 ic.patch(*code);
2366 Handle<Code> code = stub.GetCode();
2367 if (!code.is_null()) {
2376 ic.patch(*code);
2378 // Activate inlined smi code.
2441 Handle<Code> CompareIC::GetUninitialized(Token::Value op) {
2447 CompareIC::State CompareIC::ComputeState(Code* target) {
2525 RUNTIME_FUNCTION(Code*, CompareIC_Miss) {
2547 Handle<Code> code = stub.GetCode();
2549 ic.patch(*code);
2554 void ToBooleanIC::patch(Code* code) {
2555 set_target(code);