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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 6717018: Introduce accessors on builtins instance (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 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
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 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2093 __ movq(result, FieldOperand(result, instr->hydrogen()->offset())); 2093 __ movq(result, FieldOperand(result, instr->hydrogen()->offset()));
2094 } 2094 }
2095 } 2095 }
2096 2096
2097 2097
2098 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 2098 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
2099 ASSERT(ToRegister(instr->object()).is(rax)); 2099 ASSERT(ToRegister(instr->object()).is(rax));
2100 ASSERT(ToRegister(instr->result()).is(rax)); 2100 ASSERT(ToRegister(instr->result()).is(rax));
2101 2101
2102 __ Move(rcx, instr->name()); 2102 __ Move(rcx, instr->name());
2103 Handle<Code> ic(isolate()->builtins()->builtin(Builtins::LoadIC_Initialize)); 2103 Handle<Code> ic = Builtins::builtin(Builtins::LoadIC_Initialize, isolate());
2104 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2104 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2105 } 2105 }
2106 2106
2107 2107
2108 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 2108 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
2109 Register function = ToRegister(instr->function()); 2109 Register function = ToRegister(instr->function());
2110 Register result = ToRegister(instr->result()); 2110 Register result = ToRegister(instr->result());
2111 2111
2112 // Check that the function really is a function. 2112 // Check that the function really is a function.
2113 __ CmpObjectType(function, JS_FUNCTION_TYPE, result); 2113 __ CmpObjectType(function, JS_FUNCTION_TYPE, result);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2219 2219
2220 // Load the result. 2220 // Load the result.
2221 __ movzxbq(result, Operand(external_elements, key, times_1, 0)); 2221 __ movzxbq(result, Operand(external_elements, key, times_1, 0));
2222 } 2222 }
2223 2223
2224 2224
2225 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 2225 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2226 ASSERT(ToRegister(instr->object()).is(rdx)); 2226 ASSERT(ToRegister(instr->object()).is(rdx));
2227 ASSERT(ToRegister(instr->key()).is(rax)); 2227 ASSERT(ToRegister(instr->key()).is(rax));
2228 2228
2229 Handle<Code> ic(isolate()->builtins()->builtin( 2229 Handle<Code> ic =
2230 Builtins::KeyedLoadIC_Initialize)); 2230 Builtins::builtin(Builtins::KeyedLoadIC_Initialize, isolate());
2231 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2231 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2232 } 2232 }
2233 2233
2234 2234
2235 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 2235 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
2236 Register result = ToRegister(instr->result()); 2236 Register result = ToRegister(instr->result());
2237 2237
2238 // Check for arguments adapter frame. 2238 // Check for arguments adapter frame.
2239 NearLabel done, adapted; 2239 NearLabel done, adapted;
2240 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); 2240 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 ASSERT(ToRegister(instr->result()).is(rax)); 2774 ASSERT(ToRegister(instr->result()).is(rax));
2775 __ Move(rdi, instr->target()); 2775 __ Move(rdi, instr->target());
2776 CallKnownFunction(instr->target(), instr->arity(), instr); 2776 CallKnownFunction(instr->target(), instr->arity(), instr);
2777 } 2777 }
2778 2778
2779 2779
2780 void LCodeGen::DoCallNew(LCallNew* instr) { 2780 void LCodeGen::DoCallNew(LCallNew* instr) {
2781 ASSERT(ToRegister(instr->InputAt(0)).is(rdi)); 2781 ASSERT(ToRegister(instr->InputAt(0)).is(rdi));
2782 ASSERT(ToRegister(instr->result()).is(rax)); 2782 ASSERT(ToRegister(instr->result()).is(rax));
2783 2783
2784 Handle<Code> builtin(isolate()->builtins()->builtin( 2784 Handle<Code> builtin =
2785 Builtins::JSConstructCall)); 2785 Builtins::builtin(Builtins::JSConstructCall, isolate());
2786 __ Set(rax, instr->arity()); 2786 __ Set(rax, instr->arity());
2787 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); 2787 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr);
2788 } 2788 }
2789 2789
2790 2790
2791 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 2791 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
2792 CallRuntime(instr->function(), instr->arity(), instr); 2792 CallRuntime(instr->function(), instr->arity(), instr);
2793 } 2793 }
2794 2794
2795 2795
(...skipping 25 matching lines...) Expand all
2821 } 2821 }
2822 } 2822 }
2823 } 2823 }
2824 2824
2825 2825
2826 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 2826 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
2827 ASSERT(ToRegister(instr->object()).is(rdx)); 2827 ASSERT(ToRegister(instr->object()).is(rdx));
2828 ASSERT(ToRegister(instr->value()).is(rax)); 2828 ASSERT(ToRegister(instr->value()).is(rax));
2829 2829
2830 __ Move(rcx, instr->hydrogen()->name()); 2830 __ Move(rcx, instr->hydrogen()->name());
2831 Handle<Code> ic(isolate()->builtins()->builtin( 2831 Builtins::Name builtin = info_->is_strict()
2832 info_->is_strict() ? Builtins::StoreIC_Initialize_Strict 2832 ? Builtins::StoreIC_Initialize_Strict
2833 : Builtins::StoreIC_Initialize)); 2833 : Builtins::StoreIC_Initialize;
2834 Handle<Code> ic = Builtins::builtin(builtin, isolate());
2834 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2835 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2835 } 2836 }
2836 2837
2837 2838
2838 void LCodeGen::DoStorePixelArrayElement(LStorePixelArrayElement* instr) { 2839 void LCodeGen::DoStorePixelArrayElement(LStorePixelArrayElement* instr) {
2839 Register external_pointer = ToRegister(instr->external_pointer()); 2840 Register external_pointer = ToRegister(instr->external_pointer());
2840 Register key = ToRegister(instr->key()); 2841 Register key = ToRegister(instr->key());
2841 Register value = ToRegister(instr->value()); 2842 Register value = ToRegister(instr->value());
2842 2843
2843 { // Clamp the value to [0..255]. 2844 { // Clamp the value to [0..255].
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2892 __ RecordWrite(elements, key, value); 2893 __ RecordWrite(elements, key, value);
2893 } 2894 }
2894 } 2895 }
2895 2896
2896 2897
2897 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 2898 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
2898 ASSERT(ToRegister(instr->object()).is(rdx)); 2899 ASSERT(ToRegister(instr->object()).is(rdx));
2899 ASSERT(ToRegister(instr->key()).is(rcx)); 2900 ASSERT(ToRegister(instr->key()).is(rcx));
2900 ASSERT(ToRegister(instr->value()).is(rax)); 2901 ASSERT(ToRegister(instr->value()).is(rax));
2901 2902
2902 Handle<Code> ic(isolate()->builtins()->builtin( 2903 Builtins::Name builtin = info_->is_strict()
2903 info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict 2904 ? Builtins::KeyedStoreIC_Initialize_Strict
2904 : Builtins::KeyedStoreIC_Initialize)); 2905 : Builtins::KeyedStoreIC_Initialize;
2906 Handle<Code> ic = Builtins::builtin(builtin, isolate());
2905 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2907 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2906 } 2908 }
2907 2909
2908 2910
2909 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { 2911 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
2910 class DeferredStringCharCodeAt: public LDeferredCode { 2912 class DeferredStringCharCodeAt: public LDeferredCode {
2911 public: 2913 public:
2912 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) 2914 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr)
2913 : LDeferredCode(codegen), instr_(instr) { } 2915 : LDeferredCode(codegen), instr_(instr) { }
2914 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } 2916 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); }
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
3823 RegisterEnvironmentForDeoptimization(environment); 3825 RegisterEnvironmentForDeoptimization(environment);
3824 ASSERT(osr_pc_offset_ == -1); 3826 ASSERT(osr_pc_offset_ == -1);
3825 osr_pc_offset_ = masm()->pc_offset(); 3827 osr_pc_offset_ = masm()->pc_offset();
3826 } 3828 }
3827 3829
3828 #undef __ 3830 #undef __
3829 3831
3830 } } // namespace v8::internal 3832 } } // namespace v8::internal
3831 3833
3832 #endif // V8_TARGET_ARCH_X64 3834 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698