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

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

Issue 42009: Fix issue 267: Functions now called with global object as receiver. (Closed)
Patch Set: Now with regression test Created 11 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 3058 matching lines...) Expand 10 before | Expand all | Expand 10 after
3069 } else { 3069 } else {
3070 // ------------------------------------------- 3070 // -------------------------------------------
3071 // JavaScript example: 'array[index](1, 2, 3)' 3071 // JavaScript example: 'array[index](1, 2, 3)'
3072 // ------------------------------------------- 3072 // -------------------------------------------
3073 3073
3074 // Load the function to call from the property through a reference. 3074 // Load the function to call from the property through a reference.
3075 Reference ref(this, property); 3075 Reference ref(this, property);
3076 ref.GetValueAndSpill(NOT_INSIDE_TYPEOF); // receiver 3076 ref.GetValueAndSpill(NOT_INSIDE_TYPEOF); // receiver
3077 3077
3078 // Pass receiver to called function. 3078 // Pass receiver to called function.
3079 __ ldr(r0, frame_->ElementAt(ref.size())); 3079 if (property->is_synthetic()) {
3080 frame_->EmitPush(r0); 3080 LoadGlobalReceiver(r0);
3081 } else {
3082 __ ldr(r0, frame_->ElementAt(ref.size()));
3083 frame_->EmitPush(r0);
3084 }
3085
3081 // Call the function. 3086 // Call the function.
3082 CallWithArguments(args, node->position()); 3087 CallWithArguments(args, node->position());
3083 frame_->EmitPush(r0); 3088 frame_->EmitPush(r0);
3084 } 3089 }
3085 3090
3086 } else { 3091 } else {
3087 // ---------------------------------- 3092 // ----------------------------------
3088 // JavaScript example: 'foo(1, 2, 3)' // foo is not global 3093 // JavaScript example: 'foo(1, 2, 3)' // foo is not global
3089 // ---------------------------------- 3094 // ----------------------------------
3090 3095
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after
5157 __ mov(r2, Operand(0)); 5162 __ mov(r2, Operand(0));
5158 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); 5163 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
5159 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), 5164 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)),
5160 RelocInfo::CODE_TARGET); 5165 RelocInfo::CODE_TARGET);
5161 } 5166 }
5162 5167
5163 5168
5164 #undef __ 5169 #undef __
5165 5170
5166 } } // namespace v8::internal 5171 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/codegen-ia32.cc » ('j') | src/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698