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

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

Issue 6286043: Direct call to eval passes strict mode through. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code review feedback. Created 9 years, 10 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/x64/codegen-x64.h ('k') | src/x64/full-codegen-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 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 5384 matching lines...) Expand 10 before | Expand all | Expand 10 after
5395 NOT_INSIDE_TYPEOF, 5395 NOT_INSIDE_TYPEOF,
5396 &slow); 5396 &slow);
5397 frame_->Push(&fun); 5397 frame_->Push(&fun);
5398 if (arg_count > 0) { 5398 if (arg_count > 0) {
5399 frame_->PushElementAt(arg_count); 5399 frame_->PushElementAt(arg_count);
5400 } else { 5400 } else {
5401 frame_->Push(Factory::undefined_value()); 5401 frame_->Push(Factory::undefined_value());
5402 } 5402 }
5403 frame_->PushParameterAt(-1); 5403 frame_->PushParameterAt(-1);
5404 5404
5405 // Push the strict mode flag.
5406 frame_->Push(Smi::FromInt(strict_mode_flag()));
5407
5405 // Resolve the call. 5408 // Resolve the call.
5406 result = 5409 result =
5407 frame_->CallRuntime(Runtime::kResolvePossiblyDirectEvalNoLookup, 3); 5410 frame_->CallRuntime(Runtime::kResolvePossiblyDirectEvalNoLookup, 4);
5408 5411
5409 done.Jump(&result); 5412 done.Jump(&result);
5410 slow.Bind(); 5413 slow.Bind();
5411 } 5414 }
5412 5415
5413 // Prepare the stack for the call to ResolvePossiblyDirectEval by 5416 // Prepare the stack for the call to ResolvePossiblyDirectEval by
5414 // pushing the loaded function, the first argument to the eval 5417 // pushing the loaded function, the first argument to the eval
5415 // call and the receiver. 5418 // call and the receiver.
5416 frame_->PushElementAt(arg_count + 1); 5419 frame_->PushElementAt(arg_count + 1);
5417 if (arg_count > 0) { 5420 if (arg_count > 0) {
5418 frame_->PushElementAt(arg_count); 5421 frame_->PushElementAt(arg_count);
5419 } else { 5422 } else {
5420 frame_->Push(Factory::undefined_value()); 5423 frame_->Push(Factory::undefined_value());
5421 } 5424 }
5422 frame_->PushParameterAt(-1); 5425 frame_->PushParameterAt(-1);
5423 5426
5427 // Push the strict mode flag.
5428 frame_->Push(Smi::FromInt(strict_mode_flag()));
5429
5424 // Resolve the call. 5430 // Resolve the call.
5425 result = frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 3); 5431 result = frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 4);
5426 5432
5427 // If we generated fast-case code bind the jump-target where fast 5433 // If we generated fast-case code bind the jump-target where fast
5428 // and slow case merge. 5434 // and slow case merge.
5429 if (done.is_linked()) done.Bind(&result); 5435 if (done.is_linked()) done.Bind(&result);
5430 5436
5431 // The runtime call returns a pair of values in rax (function) and 5437 // The runtime call returns a pair of values in rax (function) and
5432 // rdx (receiver). Touch up the stack with the right values. 5438 // rdx (receiver). Touch up the stack with the right values.
5433 Result receiver = allocator_->Allocate(rdx); 5439 Result receiver = allocator_->Allocate(rdx);
5434 frame_->SetElementAt(arg_count + 1, &result); 5440 frame_->SetElementAt(arg_count + 1, &result);
5435 frame_->SetElementAt(arg_count, &receiver); 5441 frame_->SetElementAt(arg_count, &receiver);
(...skipping 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after
8798 } 8804 }
8799 8805
8800 #endif 8806 #endif
8801 8807
8802 8808
8803 #undef __ 8809 #undef __
8804 8810
8805 } } // namespace v8::internal 8811 } } // namespace v8::internal
8806 8812
8807 #endif // V8_TARGET_ARCH_X64 8813 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698