Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 102563004: Zonify types in compiler frontend (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/codegen-x64.h ('k') | test/cctest/test-ast.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 1109
1110 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { 1110 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) {
1111 __ jmp(code, RelocInfo::CODE_TARGET); 1111 __ jmp(code, RelocInfo::CODE_TARGET);
1112 } 1112 }
1113 1113
1114 1114
1115 #undef __ 1115 #undef __
1116 #define __ ACCESS_MASM((masm())) 1116 #define __ ACCESS_MASM((masm()))
1117 1117
1118 1118
1119 Register StubCompiler::CheckPrototypes(Handle<Type> type, 1119 Register StubCompiler::CheckPrototypes(Handle<HeapType> type,
1120 Register object_reg, 1120 Register object_reg,
1121 Handle<JSObject> holder, 1121 Handle<JSObject> holder,
1122 Register holder_reg, 1122 Register holder_reg,
1123 Register scratch1, 1123 Register scratch1,
1124 Register scratch2, 1124 Register scratch2,
1125 Handle<Name> name, 1125 Handle<Name> name,
1126 int save_at_depth, 1126 int save_at_depth,
1127 Label* miss, 1127 Label* miss,
1128 PrototypeCheckType check) { 1128 PrototypeCheckType check) {
1129 Handle<Map> receiver_map(IC::TypeToMap(*type, isolate())); 1129 Handle<Map> receiver_map(IC::TypeToMap(*type, isolate()));
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 Label success; 1261 Label success;
1262 __ jmp(&success); 1262 __ jmp(&success);
1263 GenerateRestoreName(masm(), miss, name); 1263 GenerateRestoreName(masm(), miss, name);
1264 TailCallBuiltin(masm(), MissBuiltin(kind())); 1264 TailCallBuiltin(masm(), MissBuiltin(kind()));
1265 __ bind(&success); 1265 __ bind(&success);
1266 } 1266 }
1267 } 1267 }
1268 1268
1269 1269
1270 Register LoadStubCompiler::CallbackHandlerFrontend( 1270 Register LoadStubCompiler::CallbackHandlerFrontend(
1271 Handle<Type> type, 1271 Handle<HeapType> type,
1272 Register object_reg, 1272 Register object_reg,
1273 Handle<JSObject> holder, 1273 Handle<JSObject> holder,
1274 Handle<Name> name, 1274 Handle<Name> name,
1275 Handle<Object> callback) { 1275 Handle<Object> callback) {
1276 Label miss; 1276 Label miss;
1277 1277
1278 Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss); 1278 Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss);
1279 1279
1280 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { 1280 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
1281 ASSERT(!reg.is(scratch2())); 1281 ASSERT(!reg.is(scratch2()));
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2678 __ bind(&miss); 2678 __ bind(&miss);
2679 2679
2680 TailCallBuiltin(masm(), MissBuiltin(kind())); 2680 TailCallBuiltin(masm(), MissBuiltin(kind()));
2681 2681
2682 // Return the generated code. 2682 // Return the generated code.
2683 return GetICCode( 2683 return GetICCode(
2684 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); 2684 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
2685 } 2685 }
2686 2686
2687 2687
2688 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type, 2688 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type,
2689 Handle<JSObject> last, 2689 Handle<JSObject> last,
2690 Handle<Name> name) { 2690 Handle<Name> name) {
2691 NonexistentHandlerFrontend(type, last, name); 2691 NonexistentHandlerFrontend(type, last, name);
2692 2692
2693 // Return undefined if maps of the full prototype chain are still the 2693 // Return undefined if maps of the full prototype chain are still the
2694 // same and no global property with this name contains a value. 2694 // same and no global property with this name contains a value.
2695 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); 2695 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
2696 __ ret(0); 2696 __ ret(0);
2697 2697
2698 // Return the generated code. 2698 // Return the generated code.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
2777 } 2777 }
2778 __ ret(0); 2778 __ ret(0);
2779 } 2779 }
2780 2780
2781 2781
2782 #undef __ 2782 #undef __
2783 #define __ ACCESS_MASM(masm()) 2783 #define __ ACCESS_MASM(masm())
2784 2784
2785 2785
2786 Handle<Code> LoadStubCompiler::CompileLoadGlobal( 2786 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
2787 Handle<Type> type, 2787 Handle<HeapType> type,
2788 Handle<GlobalObject> global, 2788 Handle<GlobalObject> global,
2789 Handle<PropertyCell> cell, 2789 Handle<PropertyCell> cell,
2790 Handle<Name> name, 2790 Handle<Name> name,
2791 bool is_dont_delete) { 2791 bool is_dont_delete) {
2792 Label miss; 2792 Label miss;
2793 // TODO(verwaest): Directly store to rax. Currently we cannot do this, since 2793 // TODO(verwaest): Directly store to rax. Currently we cannot do this, since
2794 // rax is used as receiver(), which we would otherwise clobber before a 2794 // rax is used as receiver(), which we would otherwise clobber before a
2795 // potential miss. 2795 // potential miss.
2796 HandlerFrontendHeader(type, receiver(), global, name, &miss); 2796 HandlerFrontendHeader(type, receiver(), global, name, &miss);
2797 2797
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2834 2834
2835 Label number_case; 2835 Label number_case;
2836 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 2836 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
2837 __ JumpIfSmi(receiver(), smi_target); 2837 __ JumpIfSmi(receiver(), smi_target);
2838 2838
2839 Register map_reg = scratch1(); 2839 Register map_reg = scratch1();
2840 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); 2840 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
2841 int receiver_count = types->length(); 2841 int receiver_count = types->length();
2842 int number_of_handled_maps = 0; 2842 int number_of_handled_maps = 0;
2843 for (int current = 0; current < receiver_count; ++current) { 2843 for (int current = 0; current < receiver_count; ++current) {
2844 Handle<Type> type = types->at(current); 2844 Handle<HeapType> type = types->at(current);
2845 Handle<Map> map = IC::TypeToMap(*type, isolate()); 2845 Handle<Map> map = IC::TypeToMap(*type, isolate());
2846 if (!map->is_deprecated()) { 2846 if (!map->is_deprecated()) {
2847 number_of_handled_maps++; 2847 number_of_handled_maps++;
2848 // Check map and tail call if there's a match 2848 // Check map and tail call if there's a match
2849 __ Cmp(map_reg, map); 2849 __ Cmp(map_reg, map);
2850 if (type->Is(Type::Number())) { 2850 if (type->Is(HeapType::Number())) {
2851 ASSERT(!number_case.is_unused()); 2851 ASSERT(!number_case.is_unused());
2852 __ bind(&number_case); 2852 __ bind(&number_case);
2853 } 2853 }
2854 __ j(equal, handlers->at(current), RelocInfo::CODE_TARGET); 2854 __ j(equal, handlers->at(current), RelocInfo::CODE_TARGET);
2855 } 2855 }
2856 } 2856 }
2857 ASSERT(number_of_handled_maps > 0); 2857 ASSERT(number_of_handled_maps > 0);
2858 2858
2859 __ bind(&miss); 2859 __ bind(&miss);
2860 TailCallBuiltin(masm(), MissBuiltin(kind())); 2860 TailCallBuiltin(masm(), MissBuiltin(kind()));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2910 // ----------------------------------- 2910 // -----------------------------------
2911 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 2911 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
2912 } 2912 }
2913 2913
2914 2914
2915 #undef __ 2915 #undef __
2916 2916
2917 } } // namespace v8::internal 2917 } } // namespace v8::internal
2918 2918
2919 #endif // V8_TARGET_ARCH_X64 2919 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.h ('k') | test/cctest/test-ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698