Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/compiler/compiler-source-position-table.h" | 9 #include "src/compiler/compiler-source-position-table.h" |
| 10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 | 255 |
| 256 // Computes local variable liveness and replaces dead variables in | 256 // Computes local variable liveness and replaces dead variables in |
| 257 // frame states with the undefined values. | 257 // frame states with the undefined values. |
| 258 void ClearNonLiveSlotsInFrameStates(); | 258 void ClearNonLiveSlotsInFrameStates(); |
| 259 | 259 |
| 260 Node** EnsureInputBufferSize(int size); | 260 Node** EnsureInputBufferSize(int size); |
| 261 | 261 |
| 262 // Named and keyed loads require a VectorSlotPair for successful lowering. | 262 // Named and keyed loads require a VectorSlotPair for successful lowering. |
| 263 VectorSlotPair CreateVectorSlotPair(FeedbackVectorSlot slot) const; | 263 VectorSlotPair CreateVectorSlotPair(FeedbackVectorSlot slot) const; |
| 264 | 264 |
| 265 // Determine which contexts need to be checked for extension objects that | |
| 266 // might shadow the optimistic declaration of dynamic lookup variables. | |
| 267 uint32_t ComputeBitsetForDynamicGlobal(Variable* variable); | |
| 268 uint32_t ComputeBitsetForDynamicContext(Variable* variable); | |
| 269 | |
| 270 // Computes the frequency for JSCallFunction and JSCallConstruct nodes. | 265 // Computes the frequency for JSCallFunction and JSCallConstruct nodes. |
| 271 float ComputeCallFrequency(FeedbackVectorSlot slot) const; | 266 float ComputeCallFrequency(FeedbackVectorSlot slot) const; |
| 272 | 267 |
| 273 // =========================================================================== | 268 // =========================================================================== |
| 274 // The following build methods all generate graph fragments and return one | 269 // The following build methods all generate graph fragments and return one |
| 275 // resulting node. The operand stack height remains the same, variables and | 270 // resulting node. The operand stack height remains the same, variables and |
| 276 // other dependencies tracked by the environment might be mutated though. | 271 // other dependencies tracked by the environment might be mutated though. |
| 277 | 272 |
| 278 // Builders to create local function, script and block contexts. | 273 // Builders to create local function, script and block contexts. |
| 279 Node* BuildLocalActivationContext(Node* context); | 274 Node* BuildLocalActivationContext(Node* context); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 Handle<Name> name, const VectorSlotPair& feedback); | 320 Handle<Name> name, const VectorSlotPair& feedback); |
| 326 Node* BuildKeyedSuperLoad(Node* receiver, Node* home_object, Node* key, | 321 Node* BuildKeyedSuperLoad(Node* receiver, Node* home_object, Node* key, |
| 327 const VectorSlotPair& feedback); | 322 const VectorSlotPair& feedback); |
| 328 | 323 |
| 329 // Builders for global variable loads and stores. | 324 // Builders for global variable loads and stores. |
| 330 Node* BuildGlobalLoad(Handle<Name> name, const VectorSlotPair& feedback, | 325 Node* BuildGlobalLoad(Handle<Name> name, const VectorSlotPair& feedback, |
| 331 TypeofMode typeof_mode); | 326 TypeofMode typeof_mode); |
| 332 Node* BuildGlobalStore(Handle<Name> name, Node* value, | 327 Node* BuildGlobalStore(Handle<Name> name, Node* value, |
| 333 const VectorSlotPair& feedback); | 328 const VectorSlotPair& feedback); |
| 334 | 329 |
| 335 // Builders for dynamic variable loads and stores. | 330 // Builders for dynamic variable loads and stores. |
|
Michael Starzinger
2016/11/23 10:15:48
nit: Implementation of these two methods is gone,
rmcilroy
2016/11/23 13:48:51
Opps, done.
| |
| 336 Node* BuildDynamicLoad(Handle<Name> name, TypeofMode typeof_mode); | 331 Node* BuildDynamicLoad(Handle<Name> name, TypeofMode typeof_mode); |
| 337 Node* BuildDynamicStore(Handle<Name> name, Node* value); | 332 Node* BuildDynamicStore(Handle<Name> name, Node* value); |
| 338 | 333 |
| 339 // Builders for accessing the function context. | 334 // Builders for accessing the function context. |
| 340 Node* BuildLoadGlobalObject(); | 335 Node* BuildLoadGlobalObject(); |
| 341 Node* BuildLoadNativeContextField(int index); | 336 Node* BuildLoadNativeContextField(int index); |
| 342 | 337 |
| 343 // Builders for automatic type conversion. | 338 // Builders for automatic type conversion. |
| 344 Node* BuildToBoolean(Node* input, TypeFeedbackId feedback_id); | 339 Node* BuildToBoolean(Node* input, TypeFeedbackId feedback_id); |
| 345 Node* BuildToName(Node* input, BailoutId bailout_id); | 340 Node* BuildToName(Node* input, BailoutId bailout_id); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 // The following build methods have the same contract as the above ones, but | 377 // The following build methods have the same contract as the above ones, but |
| 383 // they can also return {nullptr} to indicate that no fragment was built. Note | 378 // they can also return {nullptr} to indicate that no fragment was built. Note |
| 384 // that these are optimizations, disabling any of them should still produce | 379 // that these are optimizations, disabling any of them should still produce |
| 385 // correct graphs. | 380 // correct graphs. |
| 386 | 381 |
| 387 // Optimization for variable load from global object. | 382 // Optimization for variable load from global object. |
| 388 Node* TryLoadGlobalConstant(Handle<Name> name); | 383 Node* TryLoadGlobalConstant(Handle<Name> name); |
| 389 | 384 |
| 390 // Optimization for variable load of dynamic lookup slot that is most likely | 385 // Optimization for variable load of dynamic lookup slot that is most likely |
| 391 // to resolve to a global slot or context slot (inferred from scope chain). | 386 // to resolve to a global slot or context slot (inferred from scope chain). |
| 392 Node* TryLoadDynamicVariable(Variable* variable, Handle<String> name, | 387 Node* TryLoadDynamicVariable(Variable* variable, Handle<String> name, |
|
Michael Starzinger
2016/11/23 10:15:48
nit: Implementation is gone, lets drop the declara
rmcilroy
2016/11/23 13:48:51
Done.
| |
| 393 BailoutId bailout_id, | 388 BailoutId bailout_id, |
| 394 const VectorSlotPair& feedback, | 389 const VectorSlotPair& feedback, |
| 395 OutputFrameStateCombine combine, | 390 OutputFrameStateCombine combine, |
| 396 TypeofMode typeof_mode); | 391 TypeofMode typeof_mode); |
| 397 | 392 |
| 398 // Optimizations for automatic type conversion. | 393 // Optimizations for automatic type conversion. |
| 399 Node* TryFastToBoolean(Node* input); | 394 Node* TryFastToBoolean(Node* input); |
| 400 Node* TryFastToName(Node* input); | 395 Node* TryFastToName(Node* input); |
| 401 | 396 |
| 402 // =========================================================================== | 397 // =========================================================================== |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 644 private: | 639 private: |
| 645 SourcePositionTable* const source_positions_; | 640 SourcePositionTable* const source_positions_; |
| 646 SourcePosition const start_position_; | 641 SourcePosition const start_position_; |
| 647 }; | 642 }; |
| 648 | 643 |
| 649 } // namespace compiler | 644 } // namespace compiler |
| 650 } // namespace internal | 645 } // namespace internal |
| 651 } // namespace v8 | 646 } // namespace v8 |
| 652 | 647 |
| 653 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 648 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| OLD | NEW |