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

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

Issue 1420173006: Move resolving of natives to a late stage (during code emission). That eliminates unnecessary nativ… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: r Created 5 years, 1 month 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 | « runtime/vm/compiler.cc ('k') | runtime/vm/intermediate_language.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 3375 matching lines...) Expand 10 before | Expand all | Expand 10 after
3386 bool is_dead_; 3386 bool is_dead_;
3387 bool is_last_; 3387 bool is_last_;
3388 3388
3389 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr); 3389 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr);
3390 }; 3390 };
3391 3391
3392 3392
3393 class NativeCallInstr : public TemplateDefinition<0, Throws> { 3393 class NativeCallInstr : public TemplateDefinition<0, Throws> {
3394 public: 3394 public:
3395 explicit NativeCallInstr(NativeBodyNode* node) 3395 explicit NativeCallInstr(NativeBodyNode* node)
3396 : ast_node_(*node) {} 3396 : ast_node_(*node),
3397 native_c_function_(NULL),
3398 is_bootstrap_native_(false) { }
3397 3399
3398 DECLARE_INSTRUCTION(NativeCall) 3400 DECLARE_INSTRUCTION(NativeCall)
3399 3401
3400 virtual intptr_t token_pos() const { return ast_node_.token_pos(); } 3402 virtual intptr_t token_pos() const { return ast_node_.token_pos(); }
3401 3403
3402 const Function& function() const { return ast_node_.function(); } 3404 const Function& function() const { return ast_node_.function(); }
3403 3405
3404 const String& native_name() const { 3406 const String& native_name() const {
3405 return ast_node_.native_c_function_name(); 3407 return ast_node_.native_c_function_name();
3406 } 3408 }
3407 3409
3408 NativeFunction native_c_function() const { 3410 NativeFunction native_c_function() const {
3409 return ast_node_.native_c_function(); 3411 return native_c_function_;
3410 } 3412 }
3411 3413
3412 bool is_bootstrap_native() const { 3414 bool is_bootstrap_native() const {
3413 return ast_node_.is_bootstrap_native(); 3415 return is_bootstrap_native_;
3414 } 3416 }
3415 3417
3416 bool link_lazily() const { 3418 bool link_lazily() const {
3417 return ast_node_.link_lazily(); 3419 return ast_node_.link_lazily();
3418 } 3420 }
3419 3421
3420 virtual void PrintOperandsTo(BufferFormatter* f) const; 3422 virtual void PrintOperandsTo(BufferFormatter* f) const;
3421 3423
3422 virtual bool CanDeoptimize() const { return false; } 3424 virtual bool CanDeoptimize() const { return false; }
3423 3425
3424 virtual EffectSet Effects() const { return EffectSet::All(); } 3426 virtual EffectSet Effects() const { return EffectSet::All(); }
3425 3427
3428 void SetupNative();
3429
3426 private: 3430 private:
3431 void set_native_c_function(NativeFunction value) {
3432 native_c_function_ = value;
3433 }
3434
3435 void set_is_bootstrap_native(bool value) { is_bootstrap_native_ = value; }
3436
3427 const NativeBodyNode& ast_node_; 3437 const NativeBodyNode& ast_node_;
3438 NativeFunction native_c_function_;
3439 bool is_bootstrap_native_;
3428 3440
3429 DISALLOW_COPY_AND_ASSIGN(NativeCallInstr); 3441 DISALLOW_COPY_AND_ASSIGN(NativeCallInstr);
3430 }; 3442 };
3431 3443
3432 3444
3433 class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> { 3445 class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> {
3434 public: 3446 public:
3435 DebugStepCheckInstr(intptr_t token_pos, 3447 DebugStepCheckInstr(intptr_t token_pos,
3436 RawPcDescriptors::Kind stub_kind) 3448 RawPcDescriptors::Kind stub_kind)
3437 : token_pos_(token_pos), 3449 : token_pos_(token_pos),
(...skipping 4673 matching lines...) Expand 10 before | Expand all | Expand 10 after
8111 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8123 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8112 UNIMPLEMENTED(); \ 8124 UNIMPLEMENTED(); \
8113 return NULL; \ 8125 return NULL; \
8114 } \ 8126 } \
8115 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8127 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8116 8128
8117 8129
8118 } // namespace dart 8130 } // namespace dart
8119 8131
8120 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 8132 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698