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

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

Issue 6691003: Strict mode poision pills. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 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 4243 matching lines...) Expand 10 before | Expand all | Expand 10 after
4254 void CodeGenerator::InstantiateFunction( 4254 void CodeGenerator::InstantiateFunction(
4255 Handle<SharedFunctionInfo> function_info, 4255 Handle<SharedFunctionInfo> function_info,
4256 bool pretenure) { 4256 bool pretenure) {
4257 // The inevitable call will sync frame elements to memory anyway, so 4257 // The inevitable call will sync frame elements to memory anyway, so
4258 // we do it eagerly to allow us to push the arguments directly into 4258 // we do it eagerly to allow us to push the arguments directly into
4259 // place. 4259 // place.
4260 frame_->SyncRange(0, frame_->element_count() - 1); 4260 frame_->SyncRange(0, frame_->element_count() - 1);
4261 4261
4262 // Use the fast case closure allocation code that allocates in new 4262 // Use the fast case closure allocation code that allocates in new
4263 // space for nested functions that don't need literals cloning. 4263 // space for nested functions that don't need literals cloning.
4264 if (scope()->is_function_scope() && 4264 if (!pretenure &&
4265 scope()->is_function_scope() &&
4265 function_info->num_literals() == 0 && 4266 function_info->num_literals() == 0 &&
4266 !pretenure) { 4267 !function_info->strict_mode()) { // Strict mode functions use slow path.
4267 FastNewClosureStub stub; 4268 FastNewClosureStub stub;
4268 frame_->Push(function_info); 4269 frame_->Push(function_info);
4269 Result answer = frame_->CallStub(&stub, 1); 4270 Result answer = frame_->CallStub(&stub, 1);
4270 frame_->Push(&answer); 4271 frame_->Push(&answer);
4271 } else { 4272 } else {
4272 // Call the runtime to instantiate the function based on the 4273 // Call the runtime to instantiate the function based on the
4273 // shared function info. 4274 // shared function info.
4274 frame_->EmitPush(rsi); 4275 frame_->EmitPush(rsi);
4275 frame_->EmitPush(function_info); 4276 frame_->EmitPush(function_info);
4276 frame_->EmitPush(pretenure 4277 frame_->EmitPush(pretenure
(...skipping 4557 matching lines...) Expand 10 before | Expand all | Expand 10 after
8834 } 8835 }
8835 8836
8836 #endif 8837 #endif
8837 8838
8838 8839
8839 #undef __ 8840 #undef __
8840 8841
8841 } } // namespace v8::internal 8842 } } // namespace v8::internal
8842 8843
8843 #endif // V8_TARGET_ARCH_X64 8844 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698