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

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

Issue 8399032: Handlify CompileConstructStub. (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/runtime.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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 Register scratch = name; 514 Register scratch = name;
515 __ mov(scratch, Operand(interceptor)); 515 __ mov(scratch, Operand(interceptor));
516 __ push(scratch); 516 __ push(scratch);
517 __ push(receiver); 517 __ push(receiver);
518 __ push(holder); 518 __ push(holder);
519 __ ldr(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset)); 519 __ ldr(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset));
520 __ push(scratch); 520 __ push(scratch);
521 } 521 }
522 522
523 523
524 static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm, 524 static void CompileCallLoadPropertyWithInterceptor(
525 Register receiver, 525 MacroAssembler* masm,
526 Register holder, 526 Register receiver,
527 Register name, 527 Register holder,
528 Handle<JSObject> holder_obj) { 528 Register name,
529 Handle<JSObject> holder_obj) {
529 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 530 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
530 531
531 ExternalReference ref = 532 ExternalReference ref =
532 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly), 533 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly),
533 masm->isolate()); 534 masm->isolate());
534 __ mov(r0, Operand(5)); 535 __ mov(r0, Operand(5));
535 __ mov(r1, Operand(ref)); 536 __ mov(r1, Operand(ref));
536 537
537 CEntryStub stub(1); 538 CEntryStub stub(1);
538 __ CallStub(&stub); 539 __ CallStub(&stub);
(...skipping 2554 matching lines...) Expand 10 before | Expand all | Expand 10 after
3093 3094
3094 __ bind(&miss); 3095 __ bind(&miss);
3095 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss(); 3096 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss();
3096 __ Jump(miss_ic, RelocInfo::CODE_TARGET, al); 3097 __ Jump(miss_ic, RelocInfo::CODE_TARGET, al);
3097 3098
3098 // Return the generated code. 3099 // Return the generated code.
3099 return GetCode(NORMAL, factory()->empty_string(), MEGAMORPHIC); 3100 return GetCode(NORMAL, factory()->empty_string(), MEGAMORPHIC);
3100 } 3101 }
3101 3102
3102 3103
3103 MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) { 3104 Handle<Code> ConstructStubCompiler::CompileConstructStub(
3105 Handle<JSFunction> function) {
3104 // ----------- S t a t e ------------- 3106 // ----------- S t a t e -------------
3105 // -- r0 : argc 3107 // -- r0 : argc
3106 // -- r1 : constructor 3108 // -- r1 : constructor
3107 // -- lr : return address 3109 // -- lr : return address
3108 // -- [sp] : last argument 3110 // -- [sp] : last argument
3109 // ----------------------------------- 3111 // -----------------------------------
3110 Label generic_stub_call; 3112 Label generic_stub_call;
3111 3113
3112 // Use r7 for holding undefined which is used in several places below. 3114 // Use r7 for holding undefined which is used in several places below.
3113 __ LoadRoot(r7, Heap::kUndefinedValueRootIndex); 3115 __ LoadRoot(r7, Heap::kUndefinedValueRootIndex);
(...skipping 25 matching lines...) Expand all
3139 __ CompareInstanceType(r2, r3, JS_FUNCTION_TYPE); 3141 __ CompareInstanceType(r2, r3, JS_FUNCTION_TYPE);
3140 __ Check(ne, "Function constructed by construct stub."); 3142 __ Check(ne, "Function constructed by construct stub.");
3141 #endif 3143 #endif
3142 3144
3143 // Now allocate the JSObject in new space. 3145 // Now allocate the JSObject in new space.
3144 // r0: argc 3146 // r0: argc
3145 // r1: constructor function 3147 // r1: constructor function
3146 // r2: initial map 3148 // r2: initial map
3147 // r7: undefined 3149 // r7: undefined
3148 __ ldrb(r3, FieldMemOperand(r2, Map::kInstanceSizeOffset)); 3150 __ ldrb(r3, FieldMemOperand(r2, Map::kInstanceSizeOffset));
3149 __ AllocateInNewSpace(r3, 3151 __ AllocateInNewSpace(r3, r4, r5, r6, &generic_stub_call, SIZE_IN_WORDS);
3150 r4,
3151 r5,
3152 r6,
3153 &generic_stub_call,
3154 SIZE_IN_WORDS);
3155 3152
3156 // Allocated the JSObject, now initialize the fields. Map is set to initial 3153 // Allocated the JSObject, now initialize the fields. Map is set to initial
3157 // map and properties and elements are set to empty fixed array. 3154 // map and properties and elements are set to empty fixed array.
3158 // r0: argc 3155 // r0: argc
3159 // r1: constructor function 3156 // r1: constructor function
3160 // r2: initial map 3157 // r2: initial map
3161 // r3: object size (in words) 3158 // r3: object size (in words)
3162 // r4: JSObject (not tagged) 3159 // r4: JSObject (not tagged)
3163 // r7: undefined 3160 // r7: undefined
3164 __ LoadRoot(r6, Heap::kEmptyFixedArrayRootIndex); 3161 __ LoadRoot(r6, Heap::kEmptyFixedArrayRootIndex);
(...skipping 11 matching lines...) Expand all
3176 3173
3177 // Fill all the in-object properties with undefined. 3174 // Fill all the in-object properties with undefined.
3178 // r0: argc 3175 // r0: argc
3179 // r1: first argument 3176 // r1: first argument
3180 // r3: object size (in words) 3177 // r3: object size (in words)
3181 // r4: JSObject (not tagged) 3178 // r4: JSObject (not tagged)
3182 // r5: First in-object property of JSObject (not tagged) 3179 // r5: First in-object property of JSObject (not tagged)
3183 // r7: undefined 3180 // r7: undefined
3184 // Fill the initialized properties with a constant value or a passed argument 3181 // Fill the initialized properties with a constant value or a passed argument
3185 // depending on the this.x = ...; assignment in the function. 3182 // depending on the this.x = ...; assignment in the function.
3186 SharedFunctionInfo* shared = function->shared(); 3183 Handle<SharedFunctionInfo> shared(function->shared());
3187 for (int i = 0; i < shared->this_property_assignments_count(); i++) { 3184 for (int i = 0; i < shared->this_property_assignments_count(); i++) {
3188 if (shared->IsThisPropertyAssignmentArgument(i)) { 3185 if (shared->IsThisPropertyAssignmentArgument(i)) {
3189 Label not_passed, next; 3186 Label not_passed, next;
3190 // Check if the argument assigned to the property is actually passed. 3187 // Check if the argument assigned to the property is actually passed.
3191 int arg_number = shared->GetThisPropertyAssignmentArgument(i); 3188 int arg_number = shared->GetThisPropertyAssignmentArgument(i);
3192 __ cmp(r0, Operand(arg_number)); 3189 __ cmp(r0, Operand(arg_number));
3193 __ b(le, &not_passed); 3190 __ b(le, &not_passed);
3194 // Argument passed - find it on the stack. 3191 // Argument passed - find it on the stack.
3195 __ ldr(r2, MemOperand(r1, (arg_number + 1) * -kPointerSize)); 3192 __ ldr(r2, MemOperand(r1, (arg_number + 1) * -kPointerSize));
3196 __ str(r2, MemOperand(r5, kPointerSize, PostIndex)); 3193 __ str(r2, MemOperand(r5, kPointerSize, PostIndex));
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
4245 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4242 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4246 __ Jump(ic_miss, RelocInfo::CODE_TARGET); 4243 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4247 } 4244 }
4248 4245
4249 4246
4250 #undef __ 4247 #undef __
4251 4248
4252 } } // namespace v8::internal 4249 } } // namespace v8::internal
4253 4250
4254 #endif // V8_TARGET_ARCH_ARM 4251 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698