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

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

Issue 132883017: MIPS: Fix the context check in LoadGlobalFunctionPrototype (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); 280 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset));
281 } 281 }
282 282
283 283
284 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( 284 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
285 MacroAssembler* masm, 285 MacroAssembler* masm,
286 int index, 286 int index,
287 Register prototype, 287 Register prototype,
288 Label* miss) { 288 Label* miss) {
289 Isolate* isolate = masm->isolate(); 289 Isolate* isolate = masm->isolate();
290 // Check we're still in the same context.
291 __ lw(prototype,
292 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
293 ASSERT(!prototype.is(at));
294 __ li(at, isolate->global_object());
295 __ Branch(miss, ne, prototype, Operand(at));
296 // Get the global function with the given index. 290 // Get the global function with the given index.
297 Handle<JSFunction> function( 291 Handle<JSFunction> function(
298 JSFunction::cast(isolate->native_context()->get(index))); 292 JSFunction::cast(isolate->native_context()->get(index)));
293
294 // Check we're still in the same context.
295 Register scratch = prototype;
296 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
297 __ lw(scratch, MemOperand(cp, offset));
298 __ lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset));
299 __ lw(scratch, MemOperand(scratch, Context::SlotOffset(index)));
300 __ li(at, function);
301 __ Branch(miss, ne, at, Operand(scratch));
302
299 // Load its initial map. The global functions all have initial maps. 303 // Load its initial map. The global functions all have initial maps.
300 __ li(prototype, Handle<Map>(function->initial_map())); 304 __ li(prototype, Handle<Map>(function->initial_map()));
301 // Load the prototype from the initial map. 305 // Load the prototype from the initial map.
302 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); 306 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset));
303 } 307 }
304 308
305 309
306 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, 310 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
307 Register dst, 311 Register dst,
308 Register src, 312 Register src,
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 // ----------------------------------- 1955 // -----------------------------------
1952 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1956 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1953 } 1957 }
1954 1958
1955 1959
1956 #undef __ 1960 #undef __
1957 1961
1958 } } // namespace v8::internal 1962 } } // namespace v8::internal
1959 1963
1960 #endif // V8_TARGET_ARCH_MIPS 1964 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698