Home | History | Annotate | Download | only in src

Lines Matching refs:Code

6 //     * Redistributions of source code must retain the above copyright
54 // computed from the original code - not the patched code. Let
55 // these cases fall through to the unreachable code below.
76 Code* new_target) {
86 Code* apply_builtin = isolate->builtins()->builtin(
95 Code::ExtraICState state = new_target->extra_ic_state();
97 GetTransitionMarkModifier(Code::GetKeyedAccessStoreMode(state));
124 // To improve the performance of the (much used) IC code, we unfold a few
125 // levels of the stack frame iteration code. This yields a ~35% speedup when
160 // Find the function on the stack and both the active code for the
161 // function and the original code.
164 Code* code = shared->code();
166 Code* original_code = Debug::GetDebugInfo(shared)->original_code();
168 // Get the address of the call site in the active code. This is the
172 // Return the address in the original code. This is the place where
176 original_code->instruction_start() - code->instruction_start();
182 static bool TryRemoveInvalidPrototypeDependentStub(Code* target,
195 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
224 target->type() != Code::NORMAL) {
225 Code* handler = target->FindFirstCode();
269 IC::State IC::StateFrom(Code* target, Object* receiver, Object* name) {
275 Code::Kind kind = target->kind();
276 // Remove the target from the code cache if it became invalid
281 if (kind != Code::CALL_IC && kind != Code::KEYED_CALL_IC &&
302 Code* code = Code::cast(isolate()->FindCodeObject(addr));
303 for (RelocIterator it(code, RelocInfo::kCodeTargetMask);
342 void IC::PostPatching(Address address, Code* target, Code* old_target) {
347 Code* host = isolate->
348 inner_pointer_to_code_cache()->GetCacheEntry(address)->code;
349 if (host->kind() != Code::FUNCTION) return;
356 // Not all Code objects have TypeFeedbackInfo.
379 Code* target = GetTargetAtAddress(address);
385 case Code::LOAD_IC: return LoadIC::Clear(address, target);
386 case Code::KEYED_LOAD_IC: return KeyedLoadIC::Clear(address, target);
387 case Code::STORE_IC: return StoreIC::Clear(address, target);
388 case Code::KEYED_STORE_IC: return KeyedStoreIC::Clear(address, target);
389 case Code::CALL_IC: return CallIC::Clear(address, target);
390 case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target);
391 case Code::COMPARE_IC: return CompareIC::Clear(address, target);
392 case Code::COMPARE_NIL_IC: return CompareNilIC::Clear(address, target);
393 case Code::BINARY_OP_IC:
394 case Code::TO_BOOLEAN_IC:
403 void CallICBase::Clear(Address address, Code* target) {
406 Code* code =
411 SetTargetAtAddress(address, code);
415 void KeyedLoadIC::Clear(Address address, Code* target) {
418 // do not clear these maps, cached code can keep objects alive
424 void LoadIC::Clear(Address address, Code* target) {
430 void StoreIC::Clear(Address address, Code* target) {
433 (Code::GetStrictMode(target->extra_ic_state()) == kStrictMode)
439 void KeyedStoreIC::Clear(Address address, Code* target) {
442 (Code::GetStrictMode(target->extra_ic_state()) == kStrictMode)
448 void CompareIC::Clear(Address address, Code* target) {
547 Code::ExtraICState extra_ic_state,
640 Code::ExtraICState* extra_ic_state) {
641 ASSERT(kind_ == Code::CALL_IC);
682 Handle<Code> CallICBase::ComputeMonomorphicStub(LookupResult* lookup,
684 Code::ExtraICState extra_state,
696 if (!lookup->IsConstantFunction()) return Handle<Code>::null();
697 // Get the constant function and compute the code stub for this
699 // that the code stub is in the stub cache.
706 if (!object->IsJSObject()) return Handle<Code>::null();
713 if (!cell->value()->IsJSFunction()) return Handle<Code>::null();
722 if (!holder.is_identical_to(receiver)) return Handle<Code>::null();
733 return Handle<Code>::null();
740 Code::ExtraICState extra_ic_state,
748 Handle<Code> code;
753 code = isolate()->stub_cache()->ComputeCallPreMonomorphic(
756 if (kind_ == Code::CALL_IC &&
758 code = ComputeMonomorphicStub(lookup, state, extra_ic_state,
764 code = ComputeMonomorphicStub(lookup, state, extra_ic_state,
767 code = isolate()->stub_cache()->ComputeCallMegamorphic(
771 code = ComputeMonomorphicStub(lookup, state, extra_ic_state,
776 if (code.is_null()) return;
784 set_target(*code);
787 // Cache code holding map should be consistent with
794 UpdateMegamorphicCache(cache_object->map(), *name, *code);
805 TRACE_IC(kind_ == Code::CALL_IC ? "CallIC" : "KeyedCallIC",
815 Code::kNoExtraICState,
836 Handle<Code> stub = isolate()->stub_cache()->ComputeCallMegamorphic(
837 argc, Code::KEYED_CALL_IC, Code::kNoExtraICState);
876 // Use specialized code for getting the length of strings and
882 Handle<Code> stub;
908 // Use specialized code for getting prototype of functions.
912 Handle<Code> stub;
935 if (kind() == Code::KEYED_LOAD_IC && name->AsArrayIndex(&index)) {
999 Handle<Code> code,
1001 if (code->type() == Code::NORMAL) return false;
1003 target()->type() == Code::NORMAL) {
1045 handlers.Set(handler_to_overwrite, code);
1048 handlers.Add(code);
1051 Handle<Code> ic = ComputePolymorphicIC(
1058 Handle<Code> LoadIC::ComputePolymorphicIC(MapHandleList* receiver_maps,
1068 Handle<Code> StoreIC::ComputePolymorphicIC(MapHandleList* receiver_maps,
1079 Handle<Code> handler,
1082 if (handler->type() == Code::NORMAL) return set_target(*handler);
1083 Handle<Code> ic = isolate()->stub_cache()->ComputeMonomorphicLoadIC(
1090 Handle<Code> handler,
1093 if (handler->type() == Code::NORMAL) return set_target(*handler);
1094 Handle<Code> ic = isolate()->stub_cache()->ComputeMonomorphicKeyedLoadIC(
1101 Handle<Code> handler,
1104 if (handler->type() == Code::NORMAL) return set_target(*handler);
1105 Handle<Code> ic = isolate()->stub_cache()->ComputeMonomorphicStoreIC(
1112 Handle<Code> handler,
1115 if (handler->type() == Code::NORMAL) return set_target(*handler);
1116 Handle<Code> ic = isolate()->stub_cache()->ComputeMonomorphicKeyedStoreIC(
1158 Handle<Code> code) {
1163 UpdateMonomorphicIC(receiver, code, name, strict_mode);
1167 if (target() != *code) {
1172 Code* old_handler = target()->FindFirstCode();
1173 is_same_handler = old_handler == *code;
1177 UpdateMonomorphicIC(receiver, code, name, strict_mode);
1180 if (UpdatePolymorphicIC(state, receiver, name, code, strict_mode)) {
1184 if (target()->type() != Code::NORMAL) {
1189 UpdateMegamorphicCache(receiver->map(), *name, *code);
1197 UpdateMegamorphicCache(receiver->map(), *name, *code);
1201 if (UpdatePolymorphicIC(state, receiver, name, code, strict_mode)) {
1205 UpdateMegamorphicCache(receiver->map(), *name, *code);
1226 static void GetReceiverMapsForStub(Handle<Code> stub,
1280 Handle<Code> code;
1285 code = pre_monomorphic_stub();
1287 code = ComputeLoadHandler(lookup, receiver, name);
1288 if (code.is_null()) {
1294 PatchCache(state, kNonStrictMode, receiver, name, code);
1299 void IC::UpdateMegamorphicCache(Map* map, Name* name, Code* code) {
1300 // Cache code holding map should be consistent with
1302 isolate()->stub_cache()->Set(name, map, code);
1306 Handle<Code> LoadIC::ComputeLoadHandler(LookupResult* lookup,
1324 // be embedded into code.
1325 if (constant->IsConsString()) return Handle<Code>::null();
1380 return Handle<Code>::null();
1404 Handle<Code> KeyedLoadIC::LoadElementStub(Handle<JSObject> receiver) {
1410 if (target()->type() != Code::NORMAL) {
1426 GetReceiverMapsForStub(Handle<Code>(target(), isolate()),
1486 Handle<Code> stub = generic_stub();
1521 Handle<Code> KeyedLoadIC::ComputeLoadHandler(LookupResult* lookup,
1525 if (!lookup->IsProperty()) return Handle<Code>::null();
1537 // be embedded into code.
1538 if (constant->IsConsString()) return Handle<Code>::null();
1562 return Handle<Code>::null();
1678 // Use specialized code for setting the length of arrays with fast
1688 Handle<Code> stub =
1697 if (FLAG_use_ic && kind() != Code::KEYED_STORE_IC) {
1700 Handle<Code> stub = (strict_mode == kStrictMode)
1723 Handle<Code> stub = strict_mode == kStrictMode
1746 Handle<Code> code = ComputeStoreMonomorphic(
1748 if (code.is_null()) {
1749 Handle<Code> stub = strict_mode == kStrictMode
1755 PatchCache(state, strict_mode, receiver, name, code);
1760 Handle<Code> StoreIC::ComputeStoreMonomorphic(LookupResult* lookup,
1835 return Handle<Code>::null();
1839 Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver,
1845 if (target()->type() != Code::NORMAL) {
1889 Code::GetKeyedAccessStoreMode(target()->extra_ic_state());
2133 Handle<Code> stub = (strict_mode == kStrictMode)
2170 Handle<Code> KeyedStoreIC::ComputeStoreMonomorphic(LookupResult* lookup,
2212 return Handle<Code>::null();
2229 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2317 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2319 Code::GetStrictMode(extra_ic_state),
2331 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2333 Code::GetStrictMode(extra_ic_state),
2347 // The generated code should filter out non-Smis before we get here.
2420 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2422 Code::GetStrictMode(extra_ic_state),
2435 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2437 Code::GetStrictMode(extra_ic_state),
2449 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2453 StrictModeFlag strict_mode = Code::GetStrictMode(extra_ic_state);
2467 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2471 StrictModeFlag strict_mode = Code::GetStrictMode(extra_ic_state);
2486 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2488 Code::GetStrictMode(extra_ic_state),
2500 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state();
2504 StrictModeFlag strict_mode = Code::GetStrictMode(extra_ic_state);
2514 void BinaryOpIC::patch(Code* code) {
2515 set_target(code);
2706 Handle<Code> code = stub.GetCode(isolate);
2707 if (!code.is_null()) {
2717 PrintF(" #%s @ %p]\n", Token::Name(op), static_cast<void*>(*code));
2721 ic.patch(*code);
2723 // Activate inlined smi code.
2785 Code* CompareIC::GetRawUninitialized(Token::Value op) {
2787 Code* code = NULL;
2788 CHECK(stub.FindCodeInCache(&code, Isolate::Current()));
2789 return code;
2793 Handle<Code> CompareIC::GetUninitialized(Isolate* isolate, Token::Value op) {
2999 // Activate inlined smi code.
3006 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc.
3007 RUNTIME_FUNCTION(Code*, CompareIC_Miss) {
3016 void CompareNilIC::Clear(Address address, Code* target) {
3018 Code::ExtraICState state = target->extended_extra_ic_state();
3023 Code* code = NULL;
3024 CHECK(stub.FindCodeInCache(&code, target->GetIsolate()));
3026 SetTargetAtAddress(address, code);
3040 Code::ExtraICState extra_ic_state = target()->extended_extra_ic_state();
3053 Handle<Code> code;
3058 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, stub);
3060 code = stub.GetCode(isolate());
3062 set_target(*code);
3083 Code::ExtraICState extra_ic_state) {
3086 Handle<Code> code = stub.GetCode(isolate());
3087 set_target(*code);
3097 Code