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

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

Issue 9691038: Ensure there is a smi check of the receiver for global load and call ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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/ia32/stub-cache-ia32.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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 Handle<String> name, 1387 Handle<String> name,
1388 Label* miss) { 1388 Label* miss) {
1389 ASSERT(holder->IsGlobalObject()); 1389 ASSERT(holder->IsGlobalObject());
1390 1390
1391 // Get the number of arguments. 1391 // Get the number of arguments.
1392 const int argc = arguments().immediate(); 1392 const int argc = arguments().immediate();
1393 1393
1394 // Get the receiver from the stack. 1394 // Get the receiver from the stack.
1395 __ lw(a0, MemOperand(sp, argc * kPointerSize)); 1395 __ lw(a0, MemOperand(sp, argc * kPointerSize));
1396 1396
1397 // If the object is the holder then we know that it's a global
1398 // object which can only happen for contextual calls. In this case,
1399 // the receiver cannot be a smi.
1400 if (!object.is_identical_to(holder)) {
1401 __ JumpIfSmi(a0, miss);
1402 }
1403
1404 // Check that the maps haven't changed. 1397 // Check that the maps haven't changed.
1398 __ JumpIfSmi(a0, miss);
1405 CheckPrototypes(object, a0, holder, a3, a1, t0, name, miss); 1399 CheckPrototypes(object, a0, holder, a3, a1, t0, name, miss);
1406 } 1400 }
1407 1401
1408 1402
1409 void CallStubCompiler::GenerateLoadFunctionFromCell( 1403 void CallStubCompiler::GenerateLoadFunctionFromCell(
1410 Handle<JSGlobalPropertyCell> cell, 1404 Handle<JSGlobalPropertyCell> cell,
1411 Handle<JSFunction> function, 1405 Handle<JSFunction> function,
1412 Label* miss) { 1406 Label* miss) {
1413 // Get the value from the cell. 1407 // Get the value from the cell.
1414 __ li(a3, Operand(cell)); 1408 __ li(a3, Operand(cell));
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after
2812 Handle<JSGlobalPropertyCell> cell, 2806 Handle<JSGlobalPropertyCell> cell,
2813 Handle<String> name, 2807 Handle<String> name,
2814 bool is_dont_delete) { 2808 bool is_dont_delete) {
2815 // ----------- S t a t e ------------- 2809 // ----------- S t a t e -------------
2816 // -- a0 : receiver 2810 // -- a0 : receiver
2817 // -- a2 : name 2811 // -- a2 : name
2818 // -- ra : return address 2812 // -- ra : return address
2819 // ----------------------------------- 2813 // -----------------------------------
2820 Label miss; 2814 Label miss;
2821 2815
2822 // If the object is the holder then we know that it's a global
2823 // object which can only happen for contextual calls. In this case,
2824 // the receiver cannot be a smi.
2825 if (!object.is_identical_to(holder)) {
2826 __ JumpIfSmi(a0, &miss);
2827 }
2828
2829 // Check that the map of the global has not changed. 2816 // Check that the map of the global has not changed.
2817 __ JumpIfSmi(a0, &miss);
2830 CheckPrototypes(object, a0, holder, a3, t0, a1, name, &miss); 2818 CheckPrototypes(object, a0, holder, a3, t0, a1, name, &miss);
2831 2819
2832 // Get the value from the cell. 2820 // Get the value from the cell.
2833 __ li(a3, Operand(cell)); 2821 __ li(a3, Operand(cell));
2834 __ lw(t0, FieldMemOperand(a3, JSGlobalPropertyCell::kValueOffset)); 2822 __ lw(t0, FieldMemOperand(a3, JSGlobalPropertyCell::kValueOffset));
2835 2823
2836 // Check for deleted property if property can actually be deleted. 2824 // Check for deleted property if property can actually be deleted.
2837 if (!is_dont_delete) { 2825 if (!is_dont_delete) {
2838 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2826 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2839 __ Branch(&miss, eq, t0, Operand(at)); 2827 __ Branch(&miss, eq, t0, Operand(at));
(...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after
4521 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4509 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4522 } 4510 }
4523 } 4511 }
4524 4512
4525 4513
4526 #undef __ 4514 #undef __
4527 4515
4528 } } // namespace v8::internal 4516 } } // namespace v8::internal
4529 4517
4530 #endif // V8_TARGET_ARCH_MIPS 4518 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698