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

Side by Side Diff: src/compiler/js-generic-lowering.cc

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Changes from review Created 4 years 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
« no previous file with comments | « src/compiler/js-create-lowering.cc ('k') | src/compiler/js-operator.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-generic-lowering.h" 5 #include "src/compiler/js-generic-lowering.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compiler/common-operator.h" 10 #include "src/compiler/common-operator.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 ReplaceWithStubCall(node, callable, flags); 344 ReplaceWithStubCall(node, callable, flags);
345 } else { 345 } else {
346 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) 346 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED)
347 ? Runtime::kNewClosure_Tenured 347 ? Runtime::kNewClosure_Tenured
348 : Runtime::kNewClosure); 348 : Runtime::kNewClosure);
349 } 349 }
350 } 350 }
351 351
352 352
353 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { 353 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) {
354 int const slot_count = OpParameter<int>(node->op()); 354 const CreateFunctionContextParameters& parameters =
355 CreateFunctionContextParametersOf(node->op());
356 int slot_count = parameters.slot_count();
357 ScopeType scope_type = parameters.scope_type();
355 CallDescriptor::Flags flags = FrameStateFlagForCall(node); 358 CallDescriptor::Flags flags = FrameStateFlagForCall(node);
356 359
357 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { 360 if (slot_count <= FastNewFunctionContextStub::MaximumSlots()) {
358 Callable callable = CodeFactory::FastNewFunctionContext(isolate()); 361 Callable callable =
362 CodeFactory::FastNewFunctionContext(isolate(), scope_type);
359 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); 363 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
360 ReplaceWithStubCall(node, callable, flags); 364 ReplaceWithStubCall(node, callable, flags);
361 } else { 365 } else {
366 node->InsertInput(zone(), 1, jsgraph()->SmiConstant(scope_type));
362 ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext); 367 ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext);
363 } 368 }
364 } 369 }
365 370
366 371
367 void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) { 372 void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) {
368 ReplaceWithRuntimeCall(node, Runtime::kCreateIterResultObject); 373 ReplaceWithRuntimeCall(node, Runtime::kCreateIterResultObject);
369 } 374 }
370 375
371 void JSGenericLowering::LowerJSCreateKeyValueArray(Node* node) { 376 void JSGenericLowering::LowerJSCreateKeyValueArray(Node* node) {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 } 621 }
617 622
618 623
619 MachineOperatorBuilder* JSGenericLowering::machine() const { 624 MachineOperatorBuilder* JSGenericLowering::machine() const {
620 return jsgraph()->machine(); 625 return jsgraph()->machine();
621 } 626 }
622 627
623 } // namespace compiler 628 } // namespace compiler
624 } // namespace internal 629 } // namespace internal
625 } // namespace v8 630 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-create-lowering.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698