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

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

Issue 26968004: Turn Load/StoreGlobal into a handler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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/code-stubs.h ('k') | src/ic.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 3133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3144 3144
3145 3145
3146 Handle<Code> LoadStubCompiler::CompileLoadGlobal( 3146 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
3147 Handle<JSObject> object, 3147 Handle<JSObject> object,
3148 Handle<GlobalObject> global, 3148 Handle<GlobalObject> global,
3149 Handle<PropertyCell> cell, 3149 Handle<PropertyCell> cell,
3150 Handle<Name> name, 3150 Handle<Name> name,
3151 bool is_dont_delete) { 3151 bool is_dont_delete) {
3152 Label success, miss; 3152 Label success, miss;
3153 3153
3154 __ CheckMap(receiver(), Handle<Map>(object->map()), &miss, DO_SMI_CHECK); 3154 HandlerFrontendHeader(object, receiver(), global, name, &miss);
3155 HandlerFrontendHeader(
3156 object, receiver(), Handle<JSObject>::cast(global), name, &miss);
3157 // Get the value from the cell. 3155 // Get the value from the cell.
3158 if (Serializer::enabled()) { 3156 if (Serializer::enabled()) {
3159 __ mov(eax, Immediate(cell)); 3157 __ mov(eax, Immediate(cell));
3160 __ mov(eax, FieldOperand(eax, PropertyCell::kValueOffset)); 3158 __ mov(eax, FieldOperand(eax, PropertyCell::kValueOffset));
3161 } else { 3159 } else {
3162 __ mov(eax, Operand::ForCell(cell)); 3160 __ mov(eax, Operand::ForCell(cell));
3163 } 3161 }
3164 3162
3165 // Check for deleted property if property can actually be deleted. 3163 // Check for deleted property if property can actually be deleted.
3166 if (!is_dont_delete) { 3164 if (!is_dont_delete) {
3167 __ cmp(eax, factory()->the_hole_value()); 3165 __ cmp(eax, factory()->the_hole_value());
3168 __ j(equal, &miss); 3166 __ j(equal, &miss);
3169 } else if (FLAG_debug_code) { 3167 } else if (FLAG_debug_code) {
3170 __ cmp(eax, factory()->the_hole_value()); 3168 __ cmp(eax, factory()->the_hole_value());
3171 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole); 3169 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole);
3172 } 3170 }
3173 3171
3174 HandlerFrontendFooter(name, &success, &miss); 3172 HandlerFrontendFooter(name, &success, &miss);
3175 __ bind(&success); 3173 __ bind(&success);
3176 3174
3177 Counters* counters = isolate()->counters(); 3175 Counters* counters = isolate()->counters();
3178 __ IncrementCounter(counters->named_load_global_stub(), 1); 3176 __ IncrementCounter(counters->named_load_global_stub(), 1);
3179 // The code above already loads the result into the return register. 3177 // The code above already loads the result into the return register.
3180 __ ret(0); 3178 __ ret(0);
3181 3179
3182 // Return the generated code. 3180 // Return the generated code.
3183 return GetICCode(kind(), Code::NORMAL, name); 3181 return GetCode(kind(), Code::NORMAL, name);
3184 } 3182 }
3185 3183
3186 3184
3187 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( 3185 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
3188 MapHandleList* receiver_maps, 3186 MapHandleList* receiver_maps,
3189 CodeHandleList* handlers, 3187 CodeHandleList* handlers,
3190 Handle<Name> name, 3188 Handle<Name> name,
3191 Code::StubType type, 3189 Code::StubType type,
3192 IcCheckType check) { 3190 IcCheckType check) {
3193 Label miss; 3191 Label miss;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
3267 // ----------------------------------- 3265 // -----------------------------------
3268 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3266 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3269 } 3267 }
3270 3268
3271 3269
3272 #undef __ 3270 #undef __
3273 3271
3274 } } // namespace v8::internal 3272 } } // namespace v8::internal
3275 3273
3276 #endif // V8_TARGET_ARCH_IA32 3274 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698