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

Side by Side Diff: src/ia32/codegen-ia32.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/ia32/codegen-ia32.h ('k') | src/ia32/full-codegen-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 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 6084 matching lines...) Expand 10 before | Expand all | Expand 10 after
6095 NOT_INSIDE_TYPEOF, 6095 NOT_INSIDE_TYPEOF,
6096 &slow); 6096 &slow);
6097 frame_->Push(&fun); 6097 frame_->Push(&fun);
6098 if (arg_count > 0) { 6098 if (arg_count > 0) {
6099 frame_->PushElementAt(arg_count); 6099 frame_->PushElementAt(arg_count);
6100 } else { 6100 } else {
6101 frame_->Push(Factory::undefined_value()); 6101 frame_->Push(Factory::undefined_value());
6102 } 6102 }
6103 frame_->PushParameterAt(-1); 6103 frame_->PushParameterAt(-1);
6104 6104
6105 // Push the strict mode flag.
6106 frame_->Push(Smi::FromInt(strict_mode_flag()));
6107
6105 // Resolve the call. 6108 // Resolve the call.
6106 result = 6109 result =
6107 frame_->CallRuntime(Runtime::kResolvePossiblyDirectEvalNoLookup, 3); 6110 frame_->CallRuntime(Runtime::kResolvePossiblyDirectEvalNoLookup, 4);
6108 6111
6109 done.Jump(&result); 6112 done.Jump(&result);
6110 slow.Bind(); 6113 slow.Bind();
6111 } 6114 }
6112 6115
6113 // Prepare the stack for the call to ResolvePossiblyDirectEval by 6116 // Prepare the stack for the call to ResolvePossiblyDirectEval by
6114 // pushing the loaded function, the first argument to the eval 6117 // pushing the loaded function, the first argument to the eval
6115 // call and the receiver. 6118 // call and the receiver.
6116 frame_->PushElementAt(arg_count + 1); 6119 frame_->PushElementAt(arg_count + 1);
6117 if (arg_count > 0) { 6120 if (arg_count > 0) {
6118 frame_->PushElementAt(arg_count); 6121 frame_->PushElementAt(arg_count);
6119 } else { 6122 } else {
6120 frame_->Push(Factory::undefined_value()); 6123 frame_->Push(Factory::undefined_value());
6121 } 6124 }
6122 frame_->PushParameterAt(-1); 6125 frame_->PushParameterAt(-1);
6123 6126
6127 // Push the strict mode flag.
6128 frame_->Push(Smi::FromInt(strict_mode_flag()));
6129
6124 // Resolve the call. 6130 // Resolve the call.
6125 result = frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 3); 6131 result = frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 4);
6126 6132
6127 // If we generated fast-case code bind the jump-target where fast 6133 // If we generated fast-case code bind the jump-target where fast
6128 // and slow case merge. 6134 // and slow case merge.
6129 if (done.is_linked()) done.Bind(&result); 6135 if (done.is_linked()) done.Bind(&result);
6130 6136
6131 // The runtime call returns a pair of values in eax (function) and 6137 // The runtime call returns a pair of values in eax (function) and
6132 // edx (receiver). Touch up the stack with the right values. 6138 // edx (receiver). Touch up the stack with the right values.
6133 Result receiver = allocator_->Allocate(edx); 6139 Result receiver = allocator_->Allocate(edx);
6134 frame_->SetElementAt(arg_count + 1, &result); 6140 frame_->SetElementAt(arg_count + 1, &result);
6135 frame_->SetElementAt(arg_count, &receiver); 6141 frame_->SetElementAt(arg_count, &receiver);
(...skipping 4174 matching lines...) Expand 10 before | Expand all | Expand 10 after
10310 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); 10316 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
10311 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); 10317 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
10312 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); 10318 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
10313 } 10319 }
10314 10320
10315 #undef __ 10321 #undef __
10316 10322
10317 } } // namespace v8::internal 10323 } } // namespace v8::internal
10318 10324
10319 #endif // V8_TARGET_ARCH_IA32 10325 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698