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

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

Issue 6677036: Fast path for strict closure creation. (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 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 4900 matching lines...) Expand 10 before | Expand all | Expand 10 after
4911 bool pretenure) { 4911 bool pretenure) {
4912 // The inevitable call will sync frame elements to memory anyway, so 4912 // The inevitable call will sync frame elements to memory anyway, so
4913 // we do it eagerly to allow us to push the arguments directly into 4913 // we do it eagerly to allow us to push the arguments directly into
4914 // place. 4914 // place.
4915 frame()->SyncRange(0, frame()->element_count() - 1); 4915 frame()->SyncRange(0, frame()->element_count() - 1);
4916 4916
4917 // Use the fast case closure allocation code that allocates in new 4917 // Use the fast case closure allocation code that allocates in new
4918 // space for nested functions that don't need literals cloning. 4918 // space for nested functions that don't need literals cloning.
4919 if (!pretenure && 4919 if (!pretenure &&
4920 scope()->is_function_scope() && 4920 scope()->is_function_scope() &&
4921 function_info->num_literals() == 0 && 4921 function_info->num_literals() == 0) {
4922 !function_info->strict_mode()) { // Strict mode functions use slow path. 4922 FastNewClosureStub stub(
4923 FastNewClosureStub stub; 4923 function_info->strict_mode() ? kStrictMode : kNonStrictMode);
4924 frame()->EmitPush(Immediate(function_info)); 4924 frame()->EmitPush(Immediate(function_info));
4925 return frame()->CallStub(&stub, 1); 4925 return frame()->CallStub(&stub, 1);
4926 } else { 4926 } else {
4927 // Call the runtime to instantiate the function based on the 4927 // Call the runtime to instantiate the function based on the
4928 // shared function info. 4928 // shared function info.
4929 frame()->EmitPush(esi); 4929 frame()->EmitPush(esi);
4930 frame()->EmitPush(Immediate(function_info)); 4930 frame()->EmitPush(Immediate(function_info));
4931 frame()->EmitPush(Immediate(pretenure 4931 frame()->EmitPush(Immediate(pretenure
4932 ? Factory::true_value() 4932 ? Factory::true_value()
4933 : Factory::false_value())); 4933 : Factory::false_value()));
(...skipping 5420 matching lines...) Expand 10 before | Expand all | Expand 10 after
10354 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); 10354 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
10355 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); 10355 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
10356 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); 10356 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
10357 } 10357 }
10358 10358
10359 #undef __ 10359 #undef __
10360 10360
10361 } } // namespace v8::internal 10361 } } // namespace v8::internal
10362 10362
10363 #endif // V8_TARGET_ARCH_IA32 10363 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698