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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 10416031: Convert CurrentContext and StoreContext to locations code generation scheme (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 const intptr_t try_index_; 355 const intptr_t try_index_;
356 356
357 DISALLOW_COPY_AND_ASSIGN(AssertBooleanComp); 357 DISALLOW_COPY_AND_ASSIGN(AssertBooleanComp);
358 }; 358 };
359 359
360 360
361 // Denotes the current context, normally held in a register. This is 361 // Denotes the current context, normally held in a register. This is
362 // a computation, not a value, because it's mutable. 362 // a computation, not a value, because it's mutable.
363 class CurrentContextComp : public TemplateComputation<0> { 363 class CurrentContextComp : public TemplateComputation<0> {
364 public: 364 public:
365 CurrentContextComp() { } 365 CurrentContextComp() : location_summary_(MakeLocationSummary()) { }
366 366
367 DECLARE_COMPUTATION(CurrentContext) 367 DECLARE_COMPUTATION(CurrentContext)
368 368
369 virtual LocationSummary* locs() const {
370 return location_summary_;
371 }
372
373 static LocationSummary* MakeLocationSummary();
374
375 virtual void EmitNativeCode(FlowGraphCompiler* compiler);
376
369 private: 377 private:
378 LocationSummary* location_summary_;
370 DISALLOW_COPY_AND_ASSIGN(CurrentContextComp); 379 DISALLOW_COPY_AND_ASSIGN(CurrentContextComp);
371 }; 380 };
372 381
373 382
374 class StoreContextComp : public TemplateComputation<1> { 383 class StoreContextComp : public TemplateComputation<1> {
375 public: 384 public:
376 explicit StoreContextComp(Value* value) { 385 explicit StoreContextComp(Value* value)
386 : location_summary_(MakeLocationSummary()) {
377 ASSERT(value != NULL); 387 ASSERT(value != NULL);
378 inputs_[0] = value; 388 inputs_[0] = value;
379 } 389 }
380 390
381 DECLARE_COMPUTATION(StoreContext); 391 DECLARE_COMPUTATION(StoreContext);
382 392
393 virtual LocationSummary* locs() const {
394 return location_summary_;
395 }
396
397 static LocationSummary* MakeLocationSummary();
398
399 virtual void EmitNativeCode(FlowGraphCompiler* compiler);
400
383 Value* value() const { return inputs_[0]; } 401 Value* value() const { return inputs_[0]; }
384 402
385 private: 403 private:
404 LocationSummary* location_summary_;
386 DISALLOW_COPY_AND_ASSIGN(StoreContextComp); 405 DISALLOW_COPY_AND_ASSIGN(StoreContextComp);
387 }; 406 };
388 407
389 408
390 class ClosureCallComp : public Computation { 409 class ClosureCallComp : public Computation {
391 public: 410 public:
392 ClosureCallComp(ClosureCallNode* node, 411 ClosureCallComp(ClosureCallNode* node,
393 intptr_t try_index, 412 intptr_t try_index,
394 ZoneGrowableArray<Value*>* arguments) 413 ZoneGrowableArray<Value*>* arguments)
395 : ast_node_(*node), 414 : ast_node_(*node),
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 const GrowableArray<BlockEntryInstr*>& block_order_; 1918 const GrowableArray<BlockEntryInstr*>& block_order_;
1900 1919
1901 private: 1920 private:
1902 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 1921 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
1903 }; 1922 };
1904 1923
1905 1924
1906 } // namespace dart 1925 } // namespace dart
1907 1926
1908 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 1927 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698