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

Side by Side Diff: src/arm/stub-cache-arm.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 | « no previous file | src/ia32/stub-cache-ia32.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 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 Handle<String> name, 1380 Handle<String> name,
1381 Label* miss) { 1381 Label* miss) {
1382 ASSERT(holder->IsGlobalObject()); 1382 ASSERT(holder->IsGlobalObject());
1383 1383
1384 // Get the number of arguments. 1384 // Get the number of arguments.
1385 const int argc = arguments().immediate(); 1385 const int argc = arguments().immediate();
1386 1386
1387 // Get the receiver from the stack. 1387 // Get the receiver from the stack.
1388 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); 1388 __ ldr(r0, MemOperand(sp, argc * kPointerSize));
1389 1389
1390 // If the object is the holder then we know that it's a global
1391 // object which can only happen for contextual calls. In this case,
1392 // the receiver cannot be a smi.
1393 if (!object.is_identical_to(holder)) {
1394 __ JumpIfSmi(r0, miss);
1395 }
1396
1397 // Check that the maps haven't changed. 1390 // Check that the maps haven't changed.
1391 __ JumpIfSmi(r0, miss);
1398 CheckPrototypes(object, r0, holder, r3, r1, r4, name, miss); 1392 CheckPrototypes(object, r0, holder, r3, r1, r4, name, miss);
1399 } 1393 }
1400 1394
1401 1395
1402 void CallStubCompiler::GenerateLoadFunctionFromCell( 1396 void CallStubCompiler::GenerateLoadFunctionFromCell(
1403 Handle<JSGlobalPropertyCell> cell, 1397 Handle<JSGlobalPropertyCell> cell,
1404 Handle<JSFunction> function, 1398 Handle<JSFunction> function,
1405 Label* miss) { 1399 Label* miss) {
1406 // Get the value from the cell. 1400 // Get the value from the cell.
1407 __ mov(r3, Operand(cell)); 1401 __ mov(r3, Operand(cell));
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
2806 Handle<JSGlobalPropertyCell> cell, 2800 Handle<JSGlobalPropertyCell> cell,
2807 Handle<String> name, 2801 Handle<String> name,
2808 bool is_dont_delete) { 2802 bool is_dont_delete) {
2809 // ----------- S t a t e ------------- 2803 // ----------- S t a t e -------------
2810 // -- r0 : receiver 2804 // -- r0 : receiver
2811 // -- r2 : name 2805 // -- r2 : name
2812 // -- lr : return address 2806 // -- lr : return address
2813 // ----------------------------------- 2807 // -----------------------------------
2814 Label miss; 2808 Label miss;
2815 2809
2816 // If the object is the holder then we know that it's a global
2817 // object which can only happen for contextual calls. In this case,
2818 // the receiver cannot be a smi.
2819 if (!object.is_identical_to(holder)) {
2820 __ JumpIfSmi(r0, &miss);
2821 }
2822
2823 // Check that the map of the global has not changed. 2810 // Check that the map of the global has not changed.
2811 __ JumpIfSmi(r0, &miss);
2824 CheckPrototypes(object, r0, holder, r3, r4, r1, name, &miss); 2812 CheckPrototypes(object, r0, holder, r3, r4, r1, name, &miss);
2825 2813
2826 // Get the value from the cell. 2814 // Get the value from the cell.
2827 __ mov(r3, Operand(cell)); 2815 __ mov(r3, Operand(cell));
2828 __ ldr(r4, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); 2816 __ ldr(r4, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset));
2829 2817
2830 // Check for deleted property if property can actually be deleted. 2818 // Check for deleted property if property can actually be deleted.
2831 if (!is_dont_delete) { 2819 if (!is_dont_delete) {
2832 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 2820 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
2833 __ cmp(r4, ip); 2821 __ cmp(r4, ip);
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after
4458 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4446 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4459 } 4447 }
4460 } 4448 }
4461 4449
4462 4450
4463 #undef __ 4451 #undef __
4464 4452
4465 } } // namespace v8::internal 4453 } } // namespace v8::internal
4466 4454
4467 #endif // V8_TARGET_ARCH_ARM 4455 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698