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

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

Issue 8375053: Handlify CompileLoadGlobal, CompileLoadElement, CompileLoadPolymorphic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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 | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/ia32/stub-cache-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3110 matching lines...) Expand 10 before | Expand all | Expand 10 after
3121 name, 3121 name,
3122 &miss); 3122 &miss);
3123 __ bind(&miss); 3123 __ bind(&miss);
3124 GenerateLoadMiss(masm(), Code::LOAD_IC); 3124 GenerateLoadMiss(masm(), Code::LOAD_IC);
3125 3125
3126 // Return the generated code. 3126 // Return the generated code.
3127 return TryGetCode(INTERCEPTOR, name); 3127 return TryGetCode(INTERCEPTOR, name);
3128 } 3128 }
3129 3129
3130 3130
3131 MaybeObject* LoadStubCompiler::CompileLoadGlobal(JSObject* object, 3131 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
3132 GlobalObject* holder, 3132 Handle<JSObject> object,
3133 JSGlobalPropertyCell* cell, 3133 Handle<GlobalObject> holder,
3134 String* name, 3134 Handle<JSGlobalPropertyCell> cell,
3135 bool is_dont_delete) { 3135 Handle<String> name,
3136 bool is_dont_delete) {
3136 // ----------- S t a t e ------------- 3137 // ----------- S t a t e -------------
3137 // -- r0 : receiver 3138 // -- r0 : receiver
3138 // -- r2 : name 3139 // -- r2 : name
3139 // -- lr : return address 3140 // -- lr : return address
3140 // ----------------------------------- 3141 // -----------------------------------
3141 Label miss; 3142 Label miss;
3142 3143
3143 // If the object is the holder then we know that it's a global 3144 // If the object is the holder then we know that it's a global
3144 // object which can only happen for contextual calls. In this case, 3145 // object which can only happen for contextual calls. In this case,
3145 // the receiver cannot be a smi. 3146 // the receiver cannot be a smi.
3146 if (object != holder) { 3147 if (!object.is_identical_to(holder)) {
3147 __ JumpIfSmi(r0, &miss); 3148 __ JumpIfSmi(r0, &miss);
3148 } 3149 }
3149 3150
3150 // Check that the map of the global has not changed. 3151 // Check that the map of the global has not changed.
3151 CheckPrototypes(object, r0, holder, r3, r4, r1, name, &miss); 3152 CheckPrototypes(object, r0, holder, r3, r4, r1, name, &miss);
3152 3153
3153 // Get the value from the cell. 3154 // Get the value from the cell.
3154 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); 3155 __ mov(r3, Operand(cell));
3155 __ ldr(r4, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); 3156 __ ldr(r4, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset));
3156 3157
3157 // Check for deleted property if property can actually be deleted. 3158 // Check for deleted property if property can actually be deleted.
3158 if (!is_dont_delete) { 3159 if (!is_dont_delete) {
3159 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 3160 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
3160 __ cmp(r4, ip); 3161 __ cmp(r4, ip);
3161 __ b(eq, &miss); 3162 __ b(eq, &miss);
3162 } 3163 }
3163 3164
3164 __ mov(r0, r4); 3165 __ mov(r0, r4);
3165 Counters* counters = masm()->isolate()->counters(); 3166 Counters* counters = masm()->isolate()->counters();
3166 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3); 3167 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3);
3167 __ Ret(); 3168 __ Ret();
3168 3169
3169 __ bind(&miss); 3170 __ bind(&miss);
3170 __ IncrementCounter(counters->named_load_global_stub_miss(), 1, r1, r3); 3171 __ IncrementCounter(counters->named_load_global_stub_miss(), 1, r1, r3);
3171 GenerateLoadMiss(masm(), Code::LOAD_IC); 3172 GenerateLoadMiss(masm(), Code::LOAD_IC);
3172 3173
3173 // Return the generated code. 3174 // Return the generated code.
3174 return TryGetCode(NORMAL, name); 3175 return GetCode(NORMAL, name);
3175 } 3176 }
3176 3177
3177 3178
3178 Handle<Code> KeyedLoadStubCompiler::CompileLoadField(Handle<String> name, 3179 Handle<Code> KeyedLoadStubCompiler::CompileLoadField(Handle<String> name,
3179 Handle<JSObject> receiver, 3180 Handle<JSObject> receiver,
3180 Handle<JSObject> holder, 3181 Handle<JSObject> holder,
3181 int index) { 3182 int index) {
3182 // ----------- S t a t e ------------- 3183 // ----------- S t a t e -------------
3183 // -- lr : return address 3184 // -- lr : return address
3184 // -- r0 : key 3185 // -- r0 : key
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
3351 3352
3352 GenerateLoadFunctionPrototype(masm(), r1, r2, r3, &miss); 3353 GenerateLoadFunctionPrototype(masm(), r1, r2, r3, &miss);
3353 __ bind(&miss); 3354 __ bind(&miss);
3354 __ DecrementCounter(counters->keyed_load_function_prototype(), 1, r2, r3); 3355 __ DecrementCounter(counters->keyed_load_function_prototype(), 1, r2, r3);
3355 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 3356 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3356 3357
3357 return GetCode(CALLBACKS, name); 3358 return GetCode(CALLBACKS, name);
3358 } 3359 }
3359 3360
3360 3361
3361 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { 3362 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
3363 Handle<Map> receiver_map) {
3362 // ----------- S t a t e ------------- 3364 // ----------- S t a t e -------------
3363 // -- lr : return address 3365 // -- lr : return address
3364 // -- r0 : key 3366 // -- r0 : key
3365 // -- r1 : receiver 3367 // -- r1 : receiver
3366 // ----------------------------------- 3368 // -----------------------------------
3367 Code* stub;
3368 ElementsKind elements_kind = receiver_map->elements_kind(); 3369 ElementsKind elements_kind = receiver_map->elements_kind();
3369 MaybeObject* maybe_stub = KeyedLoadElementStub(elements_kind).TryGetCode(); 3370 Handle<Code> stub = KeyedLoadElementStub(elements_kind).GetCode();
3370 if (!maybe_stub->To(&stub)) return maybe_stub; 3371
3371 __ DispatchMap(r1, 3372 __ DispatchMap(r1,
Kevin Millikin (Chromium) 2011/10/26 08:43:41 This probably fits all on one line, if you like th
3372 r2, 3373 r2,
3373 Handle<Map>(receiver_map), 3374 receiver_map,
3374 Handle<Code>(stub), 3375 stub,
3375 DO_SMI_CHECK); 3376 DO_SMI_CHECK);
3376 3377
3377 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); 3378 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
3378 __ Jump(ic, RelocInfo::CODE_TARGET); 3379 __ Jump(ic, RelocInfo::CODE_TARGET);
3379 3380
3380 // Return the generated code. 3381 // Return the generated code.
3381 return TryGetCode(NORMAL, NULL); 3382 return GetCode(NORMAL, factory()->empty_string());
Kevin Millikin (Chromium) 2011/10/26 08:43:41 I think this is OK (changing from NULL String* to
3382 } 3383 }
3383 3384
3384 3385
3385 MaybeObject* KeyedLoadStubCompiler::CompileLoadPolymorphic( 3386 Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic(
3386 MapList* receiver_maps, 3387 MapHandleList* receiver_maps,
3387 CodeList* handler_ics) { 3388 CodeHandleList* handler_ics) {
3388 // ----------- S t a t e ------------- 3389 // ----------- S t a t e -------------
3389 // -- lr : return address 3390 // -- lr : return address
3390 // -- r0 : key 3391 // -- r0 : key
3391 // -- r1 : receiver 3392 // -- r1 : receiver
3392 // ----------------------------------- 3393 // -----------------------------------
3393 Label miss; 3394 Label miss;
3394 __ JumpIfSmi(r1, &miss); 3395 __ JumpIfSmi(r1, &miss);
3395 3396
3396 int receiver_count = receiver_maps->length(); 3397 int receiver_count = receiver_maps->length();
3397 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); 3398 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
3398 for (int current = 0; current < receiver_count; ++current) { 3399 for (int current = 0; current < receiver_count; ++current) {
3399 Handle<Map> map(receiver_maps->at(current)); 3400 __ mov(ip, Operand(receiver_maps->at(current)));
3400 Handle<Code> code(handler_ics->at(current));
3401 __ mov(ip, Operand(map));
3402 __ cmp(r2, ip); 3401 __ cmp(r2, ip);
3403 __ Jump(code, RelocInfo::CODE_TARGET, eq); 3402 __ Jump(handler_ics->at(current), RelocInfo::CODE_TARGET, eq);
3404 } 3403 }
3405 3404
3406 __ bind(&miss); 3405 __ bind(&miss);
3407 Handle<Code> miss_ic = isolate()->builtins()->KeyedLoadIC_Miss(); 3406 Handle<Code> miss_ic = isolate()->builtins()->KeyedLoadIC_Miss();
3408 __ Jump(miss_ic, RelocInfo::CODE_TARGET, al); 3407 __ Jump(miss_ic, RelocInfo::CODE_TARGET, al);
3409 3408
3410 // Return the generated code. 3409 // Return the generated code.
3411 return TryGetCode(NORMAL, NULL, MEGAMORPHIC); 3410 return GetCode(NORMAL, factory()->empty_string(), MEGAMORPHIC);
3412 } 3411 }
3413 3412
3414 3413
3415 MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, 3414 MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
3416 int index, 3415 int index,
3417 Map* transition, 3416 Map* transition,
3418 String* name) { 3417 String* name) {
3419 // ----------- S t a t e ------------- 3418 // ----------- S t a t e -------------
3420 // -- r0 : value 3419 // -- r0 : value
3421 // -- r1 : name 3420 // -- r1 : name
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
4664 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4663 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4665 __ Jump(ic_miss, RelocInfo::CODE_TARGET); 4664 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4666 } 4665 }
4667 4666
4668 4667
4669 #undef __ 4668 #undef __
4670 4669
4671 } } // namespace v8::internal 4670 } } // namespace v8::internal
4672 4671
4673 #endif // V8_TARGET_ARCH_ARM 4672 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/ia32/stub-cache-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698