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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 2598603002: Revert "Turn the VM's dart:typed_data into a patch" (Closed)
Patch Set: Created 4 years 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/dart_api_impl.cc ('k') | runtime/vm/gypi_contents.gni » ('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) 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 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 intptr_t len = sizeof(kCommonDoubleConstants) / sizeof(double); // NOLINT 69 intptr_t len = sizeof(kCommonDoubleConstants) / sizeof(double); // NOLINT
70 for (intptr_t i = 0; i < len; i++) { 70 for (intptr_t i = 0; i < len; i++) {
71 if (Utils::DoublesBitEqual(value, kCommonDoubleConstants[i])) { 71 if (Utils::DoublesBitEqual(value, kCommonDoubleConstants[i])) {
72 return reinterpret_cast<uword>(&kCommonDoubleConstants[i]); 72 return reinterpret_cast<uword>(&kCommonDoubleConstants[i]);
73 } 73 }
74 } 74 }
75 return 0; 75 return 0;
76 } 76 }
77 77
78 78
79 #define RECOGNIZE_FACTORY(symbol, class_name, constructor_name, cid, fp) \ 79 #define RECOGNIZE_FACTORY(test_factory_symbol, cid, fp) \
80 {Symbols::k##symbol##Id, cid, fp, #symbol ", " #cid}, // NOLINT 80 {Symbols::k##test_factory_symbol##Id, cid, fp, \
81 #test_factory_symbol ", " #cid}, // NOLINT
81 82
82 static struct { 83 static struct {
83 intptr_t symbol_id; 84 intptr_t symbold_id;
84 intptr_t cid; 85 intptr_t cid;
85 intptr_t finger_print; 86 intptr_t finger_print;
86 const char* name; 87 const char* name;
87 } factory_recognizer_list[] = {RECOGNIZED_LIST_FACTORY_LIST(RECOGNIZE_FACTORY){ 88 } factory_recognizer_list[] = {RECOGNIZED_LIST_FACTORY_LIST(RECOGNIZE_FACTORY){
88 Symbols::kIllegal, -1, -1, NULL}}; 89 Symbols::kIllegal, -1, -1, NULL}};
89 90
90 #undef RECOGNIZE_FACTORY 91 #undef RECOGNIZE_FACTORY
91 92
92 intptr_t FactoryRecognizer::ResultCid(const Function& factory) { 93 intptr_t FactoryRecognizer::ResultCid(const Function& factory) {
93 ASSERT(factory.IsFactory()); 94 ASSERT(factory.IsFactory());
94 const Class& function_class = Class::Handle(factory.Owner()); 95 const Class& function_class = Class::Handle(factory.Owner());
95 const Library& lib = Library::Handle(function_class.library()); 96 const Library& lib = Library::Handle(function_class.library());
96 ASSERT((lib.raw() == Library::CoreLibrary()) || 97 ASSERT((lib.raw() == Library::CoreLibrary()) ||
97 (lib.raw() == Library::TypedDataLibrary())); 98 (lib.raw() == Library::TypedDataLibrary()));
98 const String& factory_name = String::Handle(factory.name()); 99 const String& factory_name = String::Handle(factory.name());
99 for (intptr_t i = 0; 100 for (intptr_t i = 0;
100 factory_recognizer_list[i].symbol_id != Symbols::kIllegal; i++) { 101 factory_recognizer_list[i].symbold_id != Symbols::kIllegal; i++) {
101 if (String::EqualsIgnoringPrivateKey( 102 if (String::EqualsIgnoringPrivateKey(
102 factory_name, 103 factory_name,
103 Symbols::Symbol(factory_recognizer_list[i].symbol_id))) { 104 Symbols::Symbol(factory_recognizer_list[i].symbold_id))) {
104 return factory_recognizer_list[i].cid; 105 return factory_recognizer_list[i].cid;
105 } 106 }
106 } 107 }
107 return kDynamicCid; 108 return kDynamicCid;
108 } 109 }
109 110
110 111
111 // Base class for a stack of enclosing statements of interest (e.g., 112 // Base class for a stack of enclosing statements of interest (e.g.,
112 // blocks (breakable) and loops (continuable)). 113 // blocks (breakable) and loops (continuable)).
113 class NestedStatement : public ValueObject { 114 class NestedStatement : public ValueObject {
(...skipping 4234 matching lines...) Expand 10 before | Expand all | Expand 10 after
4348 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); 4349 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks);
4349 ASSERT(found); 4350 ASSERT(found);
4350 } 4351 }
4351 4352
4352 4353
4353 void FlowGraphBuilder::Bailout(const char* reason) const { 4354 void FlowGraphBuilder::Bailout(const char* reason) const {
4354 parsed_function_.Bailout("FlowGraphBuilder", reason); 4355 parsed_function_.Bailout("FlowGraphBuilder", reason);
4355 } 4356 }
4356 4357
4357 } // namespace dart 4358 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/gypi_contents.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698