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

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

Issue 12212050: Fix allocation of array tables (use store barrier if needed, store values directly instead of via s… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 private: 2996 private:
2997 const ConstructorCallNode& ast_node_; 2997 const ConstructorCallNode& ast_node_;
2998 2998
2999 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckInstr); 2999 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckInstr);
3000 }; 3000 };
3001 3001
3002 3002
3003 class CreateArrayInstr : public TemplateDefinition<1> { 3003 class CreateArrayInstr : public TemplateDefinition<1> {
3004 public: 3004 public:
3005 CreateArrayInstr(intptr_t token_pos, 3005 CreateArrayInstr(intptr_t token_pos,
3006 ZoneGrowableArray<PushArgumentInstr*>* arguments, 3006 intptr_t num_elements,
3007 const AbstractType& type, 3007 const AbstractType& type,
3008 Value* element_type) 3008 Value* element_type)
3009 : token_pos_(token_pos), 3009 : token_pos_(token_pos),
3010 arguments_(arguments), 3010 num_elements_(num_elements),
3011 type_(type) { 3011 type_(type) {
3012 #if defined(DEBUG) 3012 #if defined(DEBUG)
3013 for (int i = 0; i < ArgumentCount(); ++i) {
3014 ASSERT(ArgumentAt(i) != NULL);
3015 }
3016 ASSERT(element_type != NULL); 3013 ASSERT(element_type != NULL);
3017 ASSERT(type_.IsZoneHandle()); 3014 ASSERT(type_.IsZoneHandle());
3018 ASSERT(!type_.IsNull()); 3015 ASSERT(!type_.IsNull());
3019 ASSERT(type_.IsFinalized()); 3016 ASSERT(type_.IsFinalized());
3020 #endif 3017 #endif
3021 inputs_[0] = element_type; 3018 inputs_[0] = element_type;
3022 } 3019 }
3023 3020
3024 DECLARE_INSTRUCTION(CreateArray) 3021 DECLARE_INSTRUCTION(CreateArray)
3025 virtual CompileType* ComputeInitialType() const; 3022 virtual CompileType* ComputeInitialType() const;
3026 3023
3027 virtual intptr_t ArgumentCount() const { return arguments_->length(); } 3024 intptr_t num_elements() const { return num_elements_; }
3028 3025
3029 intptr_t token_pos() const { return token_pos_; } 3026 intptr_t token_pos() const { return token_pos_; }
3030 PushArgumentInstr* ArgumentAt(intptr_t i) const { return (*arguments_)[i]; }
3031 const AbstractType& type() const { return type_; } 3027 const AbstractType& type() const { return type_; }
3032 Value* element_type() const { return inputs_[0]; } 3028 Value* element_type() const { return inputs_[0]; }
3033 3029
3034 virtual void PrintOperandsTo(BufferFormatter* f) const; 3030 virtual void PrintOperandsTo(BufferFormatter* f) const;
3035 3031
3036 virtual bool CanDeoptimize() const { return false; } 3032 virtual bool CanDeoptimize() const { return false; }
3037 3033
3038 virtual bool HasSideEffect() const { return true; } 3034 virtual bool HasSideEffect() const { return true; }
3039 3035
3040 private: 3036 private:
3041 const intptr_t token_pos_; 3037 const intptr_t token_pos_;
3042 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; 3038 const intptr_t num_elements_;
3043 const AbstractType& type_; 3039 const AbstractType& type_;
3044 3040
3045 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); 3041 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr);
3046 }; 3042 };
3047 3043
3048 3044
3049 class CreateClosureInstr : public TemplateDefinition<0> { 3045 class CreateClosureInstr : public TemplateDefinition<0> {
3050 public: 3046 public:
3051 CreateClosureInstr(const Function& function, 3047 CreateClosureInstr(const Function& function,
3052 ZoneGrowableArray<PushArgumentInstr*>* arguments, 3048 ZoneGrowableArray<PushArgumentInstr*>* arguments,
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
4447 ForwardInstructionIterator* current_iterator_; 4443 ForwardInstructionIterator* current_iterator_;
4448 4444
4449 private: 4445 private:
4450 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4446 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4451 }; 4447 };
4452 4448
4453 4449
4454 } // namespace dart 4450 } // namespace dart
4455 4451
4456 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4452 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698