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

Side by Side Diff: arguments/src/ia32/codegen-ia32.cc

Issue 6665067: [Arguments] Remove synthetic properties and all code dealing with them. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental
Patch Set: Created 9 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 6290 matching lines...) Expand 10 before | Expand all | Expand 10 after
6301 } 6301 }
6302 6302
6303 } else { 6303 } else {
6304 // ------------------------------------------- 6304 // -------------------------------------------
6305 // JavaScript example: 'array[index](1, 2, 3)' 6305 // JavaScript example: 'array[index](1, 2, 3)'
6306 // ------------------------------------------- 6306 // -------------------------------------------
6307 6307
6308 // Load the function to call from the property through a reference. 6308 // Load the function to call from the property through a reference.
6309 6309
6310 // Pass receiver to called function. 6310 // Pass receiver to called function.
6311 if (property->is_synthetic()) { 6311 Load(property->obj());
6312 Reference ref(this, property);
6313 ref.GetValue();
6314 // Use global object as receiver.
6315 LoadGlobalReceiver();
6316 // Call the function.
6317 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position());
6318 } else {
6319 // Push the receiver onto the frame.
6320 Load(property->obj());
6321 6312
6322 // Load the name of the function. 6313 // Load the name of the function.
6323 Load(property->key()); 6314 Load(property->key());
6324 6315
6325 // Swap the name of the function and the receiver on the stack to follow 6316 // Swap the name of the function and the receiver on the stack to
6326 // the calling convention for call ICs. 6317 // follow the calling convention for call ICs.
6327 Result key = frame_->Pop(); 6318 Result key = frame_->Pop();
6328 Result receiver = frame_->Pop(); 6319 Result receiver = frame_->Pop();
6329 frame_->Push(&key); 6320 frame_->Push(&key);
6330 frame_->Push(&receiver); 6321 frame_->Push(&receiver);
6331 key.Unuse(); 6322 key.Unuse();
6332 receiver.Unuse(); 6323 receiver.Unuse();
6333 6324
6334 // Load the arguments. 6325 // Load the arguments.
6335 int arg_count = args->length(); 6326 int arg_count = args->length();
6336 for (int i = 0; i < arg_count; i++) { 6327 for (int i = 0; i < arg_count; i++) {
6337 Load(args->at(i)); 6328 Load(args->at(i));
6338 frame_->SpillTop(); 6329 frame_->SpillTop();
6339 } 6330 }
6340 6331
6341 // Place the key on top of stack and call the IC initialization code. 6332 // Place the key on top of stack and call the IC initialization code.
6342 frame_->PushElementAt(arg_count + 1); 6333 frame_->PushElementAt(arg_count + 1);
6343 CodeForSourcePosition(node->position()); 6334 CodeForSourcePosition(node->position());
6344 Result result = 6335 Result result =
6345 frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, 6336 frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET,
6346 arg_count, 6337 arg_count,
6347 loop_nesting()); 6338 loop_nesting());
6348 frame_->Drop(); // Drop the key still on the stack. 6339 frame_->Drop(); // Drop the key still on the stack.
6349 frame_->RestoreContextRegister(); 6340 frame_->RestoreContextRegister();
6350 frame_->Push(&result); 6341 frame_->Push(&result);
6351 }
6352 } 6342 }
6353 6343
6354 } else { 6344 } else {
6355 // ---------------------------------- 6345 // ----------------------------------
6356 // JavaScript example: 'foo(1, 2, 3)' // foo is not global 6346 // JavaScript example: 'foo(1, 2, 3)' // foo is not global
6357 // ---------------------------------- 6347 // ----------------------------------
6358 6348
6359 // Load the function. 6349 // Load the function.
6360 Load(function); 6350 Load(function);
6361 6351
(...skipping 3983 matching lines...) Expand 10 before | Expand all | Expand 10 after
10345 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); 10335 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
10346 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); 10336 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
10347 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); 10337 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
10348 } 10338 }
10349 10339
10350 #undef __ 10340 #undef __
10351 10341
10352 } } // namespace v8::internal 10342 } } // namespace v8::internal
10353 10343
10354 #endif // V8_TARGET_ARCH_IA32 10344 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698