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

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
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 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after
3003 private: 3003 private:
3004 const ConstructorCallNode& ast_node_; 3004 const ConstructorCallNode& ast_node_;
3005 3005
3006 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckInstr); 3006 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckInstr);
3007 }; 3007 };
3008 3008
3009 3009
3010 class CreateArrayInstr : public TemplateDefinition<1> { 3010 class CreateArrayInstr : public TemplateDefinition<1> {
3011 public: 3011 public:
3012 CreateArrayInstr(intptr_t token_pos, 3012 CreateArrayInstr(intptr_t token_pos,
3013 ZoneGrowableArray<PushArgumentInstr*>* arguments, 3013 intptr_t num_elements,
3014 const AbstractType& type, 3014 const AbstractType& type,
3015 Value* element_type) 3015 Value* element_type)
3016 : token_pos_(token_pos), 3016 : token_pos_(token_pos),
3017 arguments_(arguments), 3017 num_elements_(num_elements),
3018 type_(type) { 3018 type_(type) {
3019 #if defined(DEBUG) 3019 #if defined(DEBUG)
3020 for (int i = 0; i < ArgumentCount(); ++i) {
3021 ASSERT(ArgumentAt(i) != NULL);
3022 }
3023 ASSERT(element_type != NULL); 3020 ASSERT(element_type != NULL);
3024 ASSERT(type_.IsZoneHandle()); 3021 ASSERT(type_.IsZoneHandle());
3025 ASSERT(!type_.IsNull()); 3022 ASSERT(!type_.IsNull());
3026 ASSERT(type_.IsFinalized()); 3023 ASSERT(type_.IsFinalized());
3027 #endif 3024 #endif
3028 inputs_[0] = element_type; 3025 inputs_[0] = element_type;
3029 } 3026 }
3030 3027
3031 DECLARE_INSTRUCTION(CreateArray) 3028 DECLARE_INSTRUCTION(CreateArray)
3032 virtual RawAbstractType* CompileType() const; 3029 virtual RawAbstractType* CompileType() const;
3033 3030
3034 virtual intptr_t ArgumentCount() const { return arguments_->length(); } 3031 intptr_t num_elements() const { return num_elements_; }
3035 3032
3036 intptr_t token_pos() const { return token_pos_; } 3033 intptr_t token_pos() const { return token_pos_; }
3037 PushArgumentInstr* ArgumentAt(intptr_t i) const { return (*arguments_)[i]; }
3038 const AbstractType& type() const { return type_; } 3034 const AbstractType& type() const { return type_; }
3039 Value* element_type() const { return inputs_[0]; } 3035 Value* element_type() const { return inputs_[0]; }
3040 3036
3041 virtual void PrintOperandsTo(BufferFormatter* f) const; 3037 virtual void PrintOperandsTo(BufferFormatter* f) const;
3042 3038
3043 virtual bool CanDeoptimize() const { return false; } 3039 virtual bool CanDeoptimize() const { return false; }
3044 3040
3045 virtual bool HasSideEffect() const { return true; } 3041 virtual bool HasSideEffect() const { return true; }
3046 3042
3047 virtual intptr_t ResultCid() const { return kArrayCid; } 3043 virtual intptr_t ResultCid() const;
3048 3044
3049 private: 3045 private:
3050 const intptr_t token_pos_; 3046 const intptr_t token_pos_;
3051 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; 3047 const intptr_t num_elements_;
3052 const AbstractType& type_; 3048 const AbstractType& type_;
3053 3049
3054 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); 3050 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr);
3055 }; 3051 };
3056 3052
3057 3053
3058 class CreateClosureInstr : public TemplateDefinition<0> { 3054 class CreateClosureInstr : public TemplateDefinition<0> {
3059 public: 3055 public:
3060 CreateClosureInstr(const Function& function, 3056 CreateClosureInstr(const Function& function,
3061 ZoneGrowableArray<PushArgumentInstr*>* arguments, 3057 ZoneGrowableArray<PushArgumentInstr*>* arguments,
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
4514 ForwardInstructionIterator* current_iterator_; 4510 ForwardInstructionIterator* current_iterator_;
4515 4511
4516 private: 4512 private:
4517 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4513 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4518 }; 4514 };
4519 4515
4520 4516
4521 } // namespace dart 4517 } // namespace dart
4522 4518
4523 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4519 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698