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

Side by Side Diff: src/ic/mips/handler-compiler-mips.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/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips64/handler-compiler-mips64.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_MIPS 7 #if V8_TARGET_ARCH_MIPS
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.
148 Register scratch = prototype;
149 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); 142 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
150 __ lw(scratch, MemOperand(cp, offset)); 143 __ lw(result, MemOperand(cp, offset));
151 __ lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); 144 __ lw(result, FieldMemOperand(result, GlobalObject::kNativeContextOffset));
152 __ lw(scratch, MemOperand(scratch, Context::SlotOffset(index))); 145 __ lw(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. 146 // Load its initial map. The global functions all have initial maps.
157 __ li(prototype, Handle<Map>(function->initial_map())); 147 __ lw(result,
148 FieldMemOperand(result, JSFunction::kPrototypeOrInitialMapOffset));
158 // Load the prototype from the initial map. 149 // Load the prototype from the initial map.
159 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); 150 __ lw(result, FieldMemOperand(result, Map::kPrototypeOffset));
160 } 151 }
161 152
162 153
163 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype( 154 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(
164 MacroAssembler* masm, Register receiver, Register scratch1, 155 MacroAssembler* masm, Register receiver, Register scratch1,
165 Register scratch2, Label* miss_label) { 156 Register scratch2, Label* miss_label) {
166 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); 157 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
167 __ Ret(USE_DELAY_SLOT); 158 __ Ret(USE_DELAY_SLOT);
168 __ mov(v0, scratch1); 159 __ mov(v0, scratch1);
169 } 160 }
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 // Return the generated code. 668 // Return the generated code.
678 return GetCode(kind(), Code::NORMAL, name); 669 return GetCode(kind(), Code::NORMAL, name);
679 } 670 }
680 671
681 672
682 #undef __ 673 #undef __
683 } 674 }
684 } // namespace v8::internal 675 } // namespace v8::internal
685 676
686 #endif // V8_TARGET_ARCH_MIPS 677 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips64/handler-compiler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698