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

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

Issue 10832365: Rename Context::global to Context::global_object, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Michael's comments. Created 8 years, 4 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
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/objects-inl.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 __ bind(&miss); 263 __ bind(&miss);
264 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, 264 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1,
265 extra2, extra3); 265 extra2, extra3);
266 } 266 }
267 267
268 268
269 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, 269 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
270 int index, 270 int index,
271 Register prototype) { 271 Register prototype) {
272 // Load the global or builtins object from the current context. 272 // Load the global or builtins object from the current context.
273 __ lw(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 273 __ lw(prototype,
274 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
274 // Load the native context from the global or builtins object. 275 // Load the native context from the global or builtins object.
275 __ lw(prototype, 276 __ lw(prototype,
276 FieldMemOperand(prototype, GlobalObject::kNativeContextOffset)); 277 FieldMemOperand(prototype, GlobalObject::kNativeContextOffset));
277 // Load the function from the native context. 278 // Load the function from the native context.
278 __ lw(prototype, MemOperand(prototype, Context::SlotOffset(index))); 279 __ lw(prototype, MemOperand(prototype, Context::SlotOffset(index)));
279 // Load the initial map. The global functions all have initial maps. 280 // Load the initial map. The global functions all have initial maps.
280 __ lw(prototype, 281 __ lw(prototype,
281 FieldMemOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset)); 282 FieldMemOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset));
282 // Load the prototype from the initial map. 283 // Load the prototype from the initial map.
283 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); 284 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset));
284 } 285 }
285 286
286 287
287 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( 288 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
288 MacroAssembler* masm, 289 MacroAssembler* masm,
289 int index, 290 int index,
290 Register prototype, 291 Register prototype,
291 Label* miss) { 292 Label* miss) {
292 Isolate* isolate = masm->isolate(); 293 Isolate* isolate = masm->isolate();
293 // Check we're still in the same context. 294 // Check we're still in the same context.
294 __ lw(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 295 __ lw(prototype,
296 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
295 ASSERT(!prototype.is(at)); 297 ASSERT(!prototype.is(at));
296 __ li(at, isolate->global()); 298 __ li(at, isolate->global_object());
297 __ Branch(miss, ne, prototype, Operand(at)); 299 __ Branch(miss, ne, prototype, Operand(at));
298 // Get the global function with the given index. 300 // Get the global function with the given index.
299 Handle<JSFunction> function( 301 Handle<JSFunction> function(
300 JSFunction::cast(isolate->native_context()->get(index))); 302 JSFunction::cast(isolate->native_context()->get(index)));
301 // Load its initial map. The global functions all have initial maps. 303 // Load its initial map. The global functions all have initial maps.
302 __ li(prototype, Handle<Map>(function->initial_map())); 304 __ li(prototype, Handle<Map>(function->initial_map()));
303 // Load the prototype from the initial map. 305 // Load the prototype from the initial map.
304 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); 306 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset));
305 } 307 }
306 308
(...skipping 4506 matching lines...) Expand 10 before | Expand all | Expand 10 after
4813 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4815 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4814 } 4816 }
4815 } 4817 }
4816 4818
4817 4819
4818 #undef __ 4820 #undef __
4819 4821
4820 } } // namespace v8::internal 4822 } } // namespace v8::internal
4821 4823
4822 #endif // V8_TARGET_ARCH_MIPS 4824 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698