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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 7068009: Pass undefined to JS builtins when called with implicit receiver. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update sputnik test expectations. Created 9 years, 7 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/builtins-arm.cc ('k') | src/arm/lithium-codegen-arm.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 SetFunctionPosition(function()); 132 SetFunctionPosition(function());
133 Comment cmnt(masm_, "[ function compiled by full code generator"); 133 Comment cmnt(masm_, "[ function compiled by full code generator");
134 134
135 #ifdef DEBUG 135 #ifdef DEBUG
136 if (strlen(FLAG_stop_at) > 0 && 136 if (strlen(FLAG_stop_at) > 0 &&
137 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { 137 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
138 __ stop("stop-at"); 138 __ stop("stop-at");
139 } 139 }
140 #endif 140 #endif
141 141
142 // Strict mode functions need to replace the receiver with undefined 142 // Strict mode functions and builtins need to replace the receiver
143 // when called as functions (without an explicit receiver 143 // with undefined when called as functions (without an explicit
144 // object). r5 is zero for method calls and non-zero for function 144 // receiver object). r5 is zero for method calls and non-zero for
145 // calls. 145 // function calls.
146 if (info->is_strict_mode()) { 146 if (info->is_strict_mode() || info->is_native()) {
147 Label ok; 147 Label ok;
148 __ cmp(r5, Operand(0)); 148 __ cmp(r5, Operand(0));
149 __ b(eq, &ok); 149 __ b(eq, &ok);
150 int receiver_offset = scope()->num_parameters() * kPointerSize; 150 int receiver_offset = scope()->num_parameters() * kPointerSize;
151 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 151 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
152 __ str(r2, MemOperand(sp, receiver_offset)); 152 __ str(r2, MemOperand(sp, receiver_offset));
153 __ bind(&ok); 153 __ bind(&ok);
154 } 154 }
155 155
156 int locals_count = scope()->num_stack_slots(); 156 int locals_count = scope()->num_stack_slots();
(...skipping 4209 matching lines...) Expand 10 before | Expand all | Expand 10 after
4366 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4366 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4367 __ add(pc, r1, Operand(masm_->CodeObject())); 4367 __ add(pc, r1, Operand(masm_->CodeObject()));
4368 } 4368 }
4369 4369
4370 4370
4371 #undef __ 4371 #undef __
4372 4372
4373 } } // namespace v8::internal 4373 } } // namespace v8::internal
4374 4374
4375 #endif // V8_TARGET_ARCH_ARM 4375 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698