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 3048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3059 Handle<Code> LoadStubCompiler::CompileLoadGlobal( | 3059 Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
3060 Handle<JSObject> object, | 3060 Handle<JSObject> object, |
3061 Handle<GlobalObject> global, | 3061 Handle<GlobalObject> global, |
3062 Handle<PropertyCell> cell, | 3062 Handle<PropertyCell> cell, |
3063 Handle<Name> name, | 3063 Handle<Name> name, |
3064 bool is_dont_delete) { | 3064 bool is_dont_delete) { |
3065 Label success, miss; | 3065 Label success, miss; |
3066 // TODO(verwaest): Directly store to rax. Currently we cannot do this, since | 3066 // TODO(verwaest): Directly store to rax. Currently we cannot do this, since |
3067 // rax is used as receiver(), which we would otherwise clobber before a | 3067 // rax is used as receiver(), which we would otherwise clobber before a |
3068 // potential miss. | 3068 // potential miss. |
3069 | 3069 HandlerFrontendHeader(object, receiver(), global, name, &miss); |
3070 __ CheckMap(receiver(), Handle<Map>(object->map()), &miss, DO_SMI_CHECK); | |
3071 HandlerFrontendHeader( | |
3072 object, receiver(), Handle<JSObject>::cast(global), name, &miss); | |
3073 | 3070 |
3074 // Get the value from the cell. | 3071 // Get the value from the cell. |
3075 __ Move(rbx, cell); | 3072 __ Move(rbx, cell); |
3076 __ movq(rbx, FieldOperand(rbx, PropertyCell::kValueOffset)); | 3073 __ movq(rbx, FieldOperand(rbx, PropertyCell::kValueOffset)); |
3077 | 3074 |
3078 // Check for deleted property if property can actually be deleted. | 3075 // Check for deleted property if property can actually be deleted. |
3079 if (!is_dont_delete) { | 3076 if (!is_dont_delete) { |
3080 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex); | 3077 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex); |
3081 __ j(equal, &miss); | 3078 __ j(equal, &miss); |
3082 } else if (FLAG_debug_code) { | 3079 } else if (FLAG_debug_code) { |
3083 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex); | 3080 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex); |
3084 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole); | 3081 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole); |
3085 } | 3082 } |
3086 | 3083 |
3087 HandlerFrontendFooter(name, &success, &miss); | 3084 HandlerFrontendFooter(name, &success, &miss); |
3088 __ bind(&success); | 3085 __ bind(&success); |
3089 | 3086 |
3090 Counters* counters = isolate()->counters(); | 3087 Counters* counters = isolate()->counters(); |
3091 __ IncrementCounter(counters->named_load_global_stub(), 1); | 3088 __ IncrementCounter(counters->named_load_global_stub(), 1); |
3092 __ movq(rax, rbx); | 3089 __ movq(rax, rbx); |
3093 __ ret(0); | 3090 __ ret(0); |
3094 | 3091 |
3095 // Return the generated code. | 3092 // Return the generated code. |
3096 return GetICCode(kind(), Code::NORMAL, name); | 3093 return GetCode(kind(), Code::NORMAL, name); |
3097 } | 3094 } |
3098 | 3095 |
3099 | 3096 |
3100 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( | 3097 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( |
3101 MapHandleList* receiver_maps, | 3098 MapHandleList* receiver_maps, |
3102 CodeHandleList* handlers, | 3099 CodeHandleList* handlers, |
3103 Handle<Name> name, | 3100 Handle<Name> name, |
3104 Code::StubType type, | 3101 Code::StubType type, |
3105 IcCheckType check) { | 3102 IcCheckType check) { |
3106 Label miss; | 3103 Label miss; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3179 // ----------------------------------- | 3176 // ----------------------------------- |
3180 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3177 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3181 } | 3178 } |
3182 | 3179 |
3183 | 3180 |
3184 #undef __ | 3181 #undef __ |
3185 | 3182 |
3186 } } // namespace v8::internal | 3183 } } // namespace v8::internal |
3187 | 3184 |
3188 #endif // V8_TARGET_ARCH_X64 | 3185 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |