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

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

Issue 146303003: 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 | « src/arm/stub-cache-arm.cc ('k') | src/x64/stub-cache-x64.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 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // Load the prototype from the initial map. 264 // Load the prototype from the initial map.
265 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 265 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
266 } 266 }
267 267
268 268
269 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( 269 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
270 MacroAssembler* masm, 270 MacroAssembler* masm,
271 int index, 271 int index,
272 Register prototype, 272 Register prototype,
273 Label* miss) { 273 Label* miss) {
274 // Check we're still in the same context.
275 __ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)),
276 masm->isolate()->global_object());
277 __ j(not_equal, miss);
278 // Get the global function with the given index. 274 // Get the global function with the given index.
279 Handle<JSFunction> function( 275 Handle<JSFunction> function(
280 JSFunction::cast(masm->isolate()->native_context()->get(index))); 276 JSFunction::cast(masm->isolate()->native_context()->get(index)));
277 // Check we're still in the same context.
278 Register scratch = prototype;
279 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
280 __ mov(scratch, Operand(esi, offset));
281 __ mov(scratch, FieldOperand(scratch, GlobalObject::kNativeContextOffset));
282 __ cmp(Operand(scratch, Context::SlotOffset(index)), function);
283 __ j(not_equal, miss);
284
281 // Load its initial map. The global functions all have initial maps. 285 // Load its initial map. The global functions all have initial maps.
282 __ Set(prototype, Immediate(Handle<Map>(function->initial_map()))); 286 __ Set(prototype, Immediate(Handle<Map>(function->initial_map())));
283 // Load the prototype from the initial map. 287 // Load the prototype from the initial map.
284 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 288 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
285 } 289 }
286 290
287 291
288 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm, 292 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
289 Register receiver, 293 Register receiver,
290 Register scratch, 294 Register scratch,
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1957 // ----------------------------------- 1961 // -----------------------------------
1958 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1962 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1959 } 1963 }
1960 1964
1961 1965
1962 #undef __ 1966 #undef __
1963 1967
1964 } } // namespace v8::internal 1968 } } // namespace v8::internal
1965 1969
1966 #endif // V8_TARGET_ARCH_IA32 1970 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698