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

Side by Side Diff: src/ic/mips64/handler-compiler-mips64.cc

Issue 778673002: Do not embed function in DirectLoadGlobalFunctionPrototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add mips, mips64, x87 Created 6 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
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x64/handler-compiler-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 132
133 NameDictionaryLookupStub::GenerateNegativeLookup( 133 NameDictionaryLookupStub::GenerateNegativeLookup(
134 masm, miss_label, &done, receiver, properties, name, scratch1); 134 masm, miss_label, &done, receiver, properties, name, scratch1);
135 __ bind(&done); 135 __ bind(&done);
136 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1); 136 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
137 } 137 }
138 138
139 139
140 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype( 140 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype(
141 MacroAssembler* masm, int index, Register prototype, Label* miss) { 141 MacroAssembler* masm, int index, Register result, Label* miss) {
142 Isolate* isolate = masm->isolate();
143 // Get the global function with the given index.
144 Handle<JSFunction> function(
145 JSFunction::cast(isolate->native_context()->get(index)));
146
147 // Check we're still in the same context. 142 // Check we're still in the same context.
148 Register scratch = prototype;
149 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); 143 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
150 __ ld(scratch, MemOperand(cp, offset)); 144 __ ld(result, MemOperand(cp, offset));
151 __ ld(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); 145 __ ld(result, FieldMemOperand(result, GlobalObject::kNativeContextOffset));
152 __ ld(scratch, MemOperand(scratch, Context::SlotOffset(index))); 146 __ ld(result, MemOperand(result, Context::SlotOffset(index)));
153 __ li(at, function);
154 __ Branch(miss, ne, at, Operand(scratch));
155
156 // Load its initial map. The global functions all have initial maps. 147 // Load its initial map. The global functions all have initial maps.
157 __ li(prototype, Handle<Map>(function->initial_map())); 148 __ ld(result,
149 FieldMemOperand(result, JSFunction::kPrototypeOrInitialMapOffset));
158 // Load the prototype from the initial map. 150 // Load the prototype from the initial map.
159 __ ld(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); 151 __ ld(result, FieldMemOperand(result, Map::kPrototypeOffset));
160 } 152 }
161 153
162 154
163 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype( 155 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(
164 MacroAssembler* masm, Register receiver, Register scratch1, 156 MacroAssembler* masm, Register receiver, Register scratch1,
165 Register scratch2, Label* miss_label) { 157 Register scratch2, Label* miss_label) {
166 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); 158 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
167 __ Ret(USE_DELAY_SLOT); 159 __ Ret(USE_DELAY_SLOT);
168 __ mov(v0, scratch1); 160 __ mov(v0, scratch1);
169 } 161 }
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 // Return the generated code. 669 // Return the generated code.
678 return GetCode(kind(), Code::NORMAL, name); 670 return GetCode(kind(), Code::NORMAL, name);
679 } 671 }
680 672
681 673
682 #undef __ 674 #undef __
683 } 675 }
684 } // namespace v8::internal 676 } // namespace v8::internal
685 677
686 #endif // V8_TARGET_ARCH_MIPS64 678 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698