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

Side by Side Diff: src/ic/arm/handler-compiler-arm.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 | « no previous file | src/ic/arm64/handler-compiler-arm64.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_ARM 7 #if V8_TARGET_ARCH_ARM
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 134
135 NameDictionaryLookupStub::GenerateNegativeLookup( 135 NameDictionaryLookupStub::GenerateNegativeLookup(
136 masm, miss_label, &done, receiver, properties, name, scratch1); 136 masm, miss_label, &done, receiver, properties, name, scratch1);
137 __ bind(&done); 137 __ bind(&done);
138 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1); 138 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
139 } 139 }
140 140
141 141
142 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype( 142 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype(
143 MacroAssembler* masm, int index, Register prototype, Label* miss) { 143 MacroAssembler* masm, int index, Register result, Label* miss) {
144 Isolate* isolate = masm->isolate();
145 // Get the global function with the given index.
146 Handle<JSFunction> function(
147 JSFunction::cast(isolate->native_context()->get(index)));
148
149 // Check we're still in the same context.
150 Register scratch = prototype;
151 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); 144 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
152 __ ldr(scratch, MemOperand(cp, offset)); 145 __ ldr(result, MemOperand(cp, offset));
153 __ ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); 146 __ ldr(result, FieldMemOperand(result, GlobalObject::kNativeContextOffset));
154 __ ldr(scratch, MemOperand(scratch, Context::SlotOffset(index))); 147 __ ldr(result, MemOperand(result, Context::SlotOffset(index)));
155 __ Move(ip, function);
156 __ cmp(ip, scratch);
157 __ b(ne, miss);
158
159 // Load its initial map. The global functions all have initial maps. 148 // Load its initial map. The global functions all have initial maps.
160 __ Move(prototype, Handle<Map>(function->initial_map())); 149 __ ldr(result,
150 FieldMemOperand(result, JSFunction::kPrototypeOrInitialMapOffset));
161 // Load the prototype from the initial map. 151 // Load the prototype from the initial map.
162 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); 152 __ ldr(result, FieldMemOperand(result, Map::kPrototypeOffset));
163 } 153 }
164 154
165 155
166 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype( 156 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(
167 MacroAssembler* masm, Register receiver, Register scratch1, 157 MacroAssembler* masm, Register receiver, Register scratch1,
168 Register scratch2, Label* miss_label) { 158 Register scratch2, Label* miss_label) {
169 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); 159 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
170 __ mov(r0, scratch1); 160 __ mov(r0, scratch1);
171 __ Ret(); 161 __ Ret();
172 } 162 }
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 // Return the generated code. 672 // Return the generated code.
683 return GetCode(kind(), Code::NORMAL, name); 673 return GetCode(kind(), Code::NORMAL, name);
684 } 674 }
685 675
686 676
687 #undef __ 677 #undef __
688 } 678 }
689 } // namespace v8::internal 679 } // namespace v8::internal
690 680
691 #endif // V8_TARGET_ARCH_ARM 681 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698