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

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

Issue 8111006: Allow new-space JSFunction objects as constant-function properties. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: rebased Created 9 years 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
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 // -- rsp[16] : api function 414 // -- rsp[16] : api function
415 // (first fast api call extra argument) 415 // (first fast api call extra argument)
416 // -- rsp[24] : api call data 416 // -- rsp[24] : api call data
417 // -- rsp[32] : last argument 417 // -- rsp[32] : last argument
418 // -- ... 418 // -- ...
419 // -- rsp[(argc + 3) * 8] : first argument 419 // -- rsp[(argc + 3) * 8] : first argument
420 // -- rsp[(argc + 4) * 8] : receiver 420 // -- rsp[(argc + 4) * 8] : receiver
421 // ----------------------------------- 421 // -----------------------------------
422 // Get the function and setup the context. 422 // Get the function and setup the context.
423 Handle<JSFunction> function = optimization.constant_function(); 423 Handle<JSFunction> function = optimization.constant_function();
424 __ Move(rdi, function); 424 __ LoadHeapObject(rdi, function);
425 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); 425 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
426 426
427 // Pass the additional arguments. 427 // Pass the additional arguments.
428 __ movq(Operand(rsp, 2 * kPointerSize), rdi); 428 __ movq(Operand(rsp, 2 * kPointerSize), rdi);
429 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 429 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
430 Handle<Object> call_data(api_call_info->data()); 430 Handle<Object> call_data(api_call_info->data());
431 if (masm->isolate()->heap()->InNewSpace(*call_data)) { 431 if (masm->isolate()->heap()->InNewSpace(*call_data)) {
432 __ Move(rcx, api_call_info); 432 __ Move(rcx, api_call_info);
433 __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset)); 433 __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset));
434 __ movq(Operand(rsp, 3 * kPointerSize), rbx); 434 __ movq(Operand(rsp, 3 * kPointerSize), rbx);
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 __ CallApiFunctionAndReturn(getter_address, kStackSpace); 1008 __ CallApiFunctionAndReturn(getter_address, kStackSpace);
1009 } 1009 }
1010 1010
1011 1011
1012 void StubCompiler::GenerateLoadConstant(Handle<JSObject> object, 1012 void StubCompiler::GenerateLoadConstant(Handle<JSObject> object,
1013 Handle<JSObject> holder, 1013 Handle<JSObject> holder,
1014 Register receiver, 1014 Register receiver,
1015 Register scratch1, 1015 Register scratch1,
1016 Register scratch2, 1016 Register scratch2,
1017 Register scratch3, 1017 Register scratch3,
1018 Handle<Object> value, 1018 Handle<JSFunction> value,
1019 Handle<String> name, 1019 Handle<String> name,
1020 Label* miss) { 1020 Label* miss) {
1021 // Check that the receiver isn't a smi. 1021 // Check that the receiver isn't a smi.
1022 __ JumpIfSmi(receiver, miss); 1022 __ JumpIfSmi(receiver, miss);
1023 1023
1024 // Check that the maps haven't changed. 1024 // Check that the maps haven't changed.
1025 CheckPrototypes( 1025 CheckPrototypes(
1026 object, receiver, holder, scratch1, scratch2, scratch3, name, miss); 1026 object, receiver, holder, scratch1, scratch2, scratch3, name, miss);
1027 1027
1028 // Return the constant value. 1028 // Return the constant value.
1029 __ Move(rax, value); 1029 __ LoadHeapObject(rax, value);
1030 __ ret(0); 1030 __ ret(0);
1031 } 1031 }
1032 1032
1033 1033
1034 void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object, 1034 void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object,
1035 Handle<JSObject> interceptor_holder, 1035 Handle<JSObject> interceptor_holder,
1036 LookupResult* lookup, 1036 LookupResult* lookup,
1037 Register receiver, 1037 Register receiver,
1038 Register name_reg, 1038 Register name_reg,
1039 Register scratch1, 1039 Register scratch1,
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 __ bind(&miss); 2571 __ bind(&miss);
2572 GenerateLoadMiss(masm(), Code::LOAD_IC); 2572 GenerateLoadMiss(masm(), Code::LOAD_IC);
2573 2573
2574 // Return the generated code. 2574 // Return the generated code.
2575 return GetCode(CALLBACKS, name); 2575 return GetCode(CALLBACKS, name);
2576 } 2576 }
2577 2577
2578 2578
2579 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, 2579 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object,
2580 Handle<JSObject> holder, 2580 Handle<JSObject> holder,
2581 Handle<Object> value, 2581 Handle<JSFunction> value,
2582 Handle<String> name) { 2582 Handle<String> name) {
2583 // ----------- S t a t e ------------- 2583 // ----------- S t a t e -------------
2584 // -- rax : receiver 2584 // -- rax : receiver
2585 // -- rcx : name 2585 // -- rcx : name
2586 // -- rsp[0] : return address 2586 // -- rsp[0] : return address
2587 // ----------------------------------- 2587 // -----------------------------------
2588 Label miss; 2588 Label miss;
2589 2589
2590 GenerateLoadConstant(object, holder, rax, rbx, rdx, rdi, value, name, &miss); 2590 GenerateLoadConstant(object, holder, rax, rbx, rdx, rdi, value, name, &miss);
2591 __ bind(&miss); 2591 __ bind(&miss);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 2725
2726 // Return the generated code. 2726 // Return the generated code.
2727 return GetCode(CALLBACKS, name); 2727 return GetCode(CALLBACKS, name);
2728 } 2728 }
2729 2729
2730 2730
2731 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant( 2731 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant(
2732 Handle<String> name, 2732 Handle<String> name,
2733 Handle<JSObject> receiver, 2733 Handle<JSObject> receiver,
2734 Handle<JSObject> holder, 2734 Handle<JSObject> holder,
2735 Handle<Object> value) { 2735 Handle<JSFunction> value) {
2736 // ----------- S t a t e ------------- 2736 // ----------- S t a t e -------------
2737 // -- rax : key 2737 // -- rax : key
2738 // -- rdx : receiver 2738 // -- rdx : receiver
2739 // -- rsp[0] : return address 2739 // -- rsp[0] : return address
2740 // ----------------------------------- 2740 // -----------------------------------
2741 Label miss; 2741 Label miss;
2742 2742
2743 Counters* counters = isolate()->counters(); 2743 Counters* counters = isolate()->counters();
2744 __ IncrementCounter(counters->keyed_load_constant_function(), 1); 2744 __ IncrementCounter(counters->keyed_load_constant_function(), 1);
2745 2745
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
3614 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 3614 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
3615 __ jmp(ic_miss, RelocInfo::CODE_TARGET); 3615 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
3616 } 3616 }
3617 3617
3618 3618
3619 #undef __ 3619 #undef __
3620 3620
3621 } } // namespace v8::internal 3621 } } // namespace v8::internal
3622 3622
3623 #endif // V8_TARGET_ARCH_X64 3623 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/x64/lithium-codegen-x64.cc ('K') | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698