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

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

Issue 3211002: Fast string construct stub (ia32 only for now). (Closed)
Patch Set: Simpler map loading Created 10 years, 3 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
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 // Cache miss: Fall-through and let caller handle the miss by 251 // Cache miss: Fall-through and let caller handle the miss by
252 // entering the runtime system. 252 // entering the runtime system.
253 __ bind(&miss); 253 __ bind(&miss);
254 } 254 }
255 255
256 256
257 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, 257 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
258 int index, 258 int index,
259 Register prototype) { 259 Register prototype) {
260 // Load the global or builtins object from the current context. 260 __ LoadGlobalFunction(index, prototype);
261 __ mov(prototype, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); 261 __ LoadGlobalFunctionInitialMap(prototype, prototype);
262 // Load the global context from the global or builtins object.
263 __ mov(prototype,
264 FieldOperand(prototype, GlobalObject::kGlobalContextOffset));
265 // Load the function from the global context.
266 __ mov(prototype, Operand(prototype, Context::SlotOffset(index)));
267 // Load the initial map. The global functions all have initial maps.
268 __ mov(prototype,
269 FieldOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset));
270 // Load the prototype from the initial map. 262 // Load the prototype from the initial map.
271 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 263 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
272 } 264 }
273 265
274 266
275 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( 267 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
276 MacroAssembler* masm, int index, Register prototype) { 268 MacroAssembler* masm, int index, Register prototype) {
277 // Get the global function with the given index. 269 // Get the global function with the given index.
278 JSFunction* function = JSFunction::cast(Top::global_context()->get(index)); 270 JSFunction* function = JSFunction::cast(Top::global_context()->get(index));
279 // Load its initial map. The global functions all have initial maps. 271 // Load its initial map. The global functions all have initial maps.
(...skipping 2452 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 // Return the generated code. 2724 // Return the generated code.
2733 return GetCode(); 2725 return GetCode();
2734 } 2726 }
2735 2727
2736 2728
2737 #undef __ 2729 #undef __
2738 2730
2739 } } // namespace v8::internal 2731 } } // namespace v8::internal
2740 2732
2741 #endif // V8_TARGET_ARCH_IA32 2733 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/ia32/builtins-ia32.cc ('K') | « src/ia32/macro-assembler-ia32.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698