OLD | NEW |
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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 frame_->SyncRange(0, frame_->element_count() - 1); | 2276 frame_->SyncRange(0, frame_->element_count() - 1); |
2277 | 2277 |
2278 // Use the fast case closure allocation code that allocates in new | 2278 // Use the fast case closure allocation code that allocates in new |
2279 // space for nested functions that don't need literals cloning. | 2279 // space for nested functions that don't need literals cloning. |
2280 if (scope()->is_function_scope() && function_info->num_literals() == 0) { | 2280 if (scope()->is_function_scope() && function_info->num_literals() == 0) { |
2281 FastNewClosureStub stub; | 2281 FastNewClosureStub stub; |
2282 frame_->Push(function_info); | 2282 frame_->Push(function_info); |
2283 Result answer = frame_->CallStub(&stub, 1); | 2283 Result answer = frame_->CallStub(&stub, 1); |
2284 frame_->Push(&answer); | 2284 frame_->Push(&answer); |
2285 } else { | 2285 } else { |
2286 // Call the runtime to instantiate the function boilerplate | 2286 // Call the runtime to instantiate the function based on the |
2287 // object. | 2287 // shared function info. |
2288 frame_->EmitPush(rsi); | 2288 frame_->EmitPush(rsi); |
2289 frame_->EmitPush(function_info); | 2289 frame_->EmitPush(function_info); |
2290 Result result = frame_->CallRuntime(Runtime::kNewClosure, 2); | 2290 Result result = frame_->CallRuntime(Runtime::kNewClosure, 2); |
2291 frame_->Push(&result); | 2291 frame_->Push(&result); |
2292 } | 2292 } |
2293 } | 2293 } |
2294 | 2294 |
2295 | 2295 |
2296 void CodeGenerator::VisitFunctionLiteral(FunctionLiteral* node) { | 2296 void CodeGenerator::VisitFunctionLiteral(FunctionLiteral* node) { |
2297 Comment cmnt(masm_, "[ FunctionLiteral"); | 2297 Comment cmnt(masm_, "[ FunctionLiteral"); |
(...skipping 8140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10438 // Call the function from C++. | 10438 // Call the function from C++. |
10439 return FUNCTION_CAST<ModuloFunction>(buffer); | 10439 return FUNCTION_CAST<ModuloFunction>(buffer); |
10440 } | 10440 } |
10441 | 10441 |
10442 #endif | 10442 #endif |
10443 | 10443 |
10444 | 10444 |
10445 #undef __ | 10445 #undef __ |
10446 | 10446 |
10447 } } // namespace v8::internal | 10447 } } // namespace v8::internal |
OLD | NEW |