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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 9646008: Implementing ConstructorCall. (part I) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_x64.cc
===================================================================
--- runtime/vm/flow_graph_compiler_x64.cc (revision 5256)
+++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
@@ -73,11 +73,11 @@
void FlowGraphCompiler::LoadValue(Register dst, Value* value) {
if (value->IsConstant()) {
ConstantVal* constant = value->AsConstant();
- if (constant->instance().IsSmi()) {
- int64_t imm = reinterpret_cast<int64_t>(constant->instance().raw());
+ if (constant->value().IsSmi()) {
+ int64_t imm = reinterpret_cast<int64_t>(constant->value().raw());
__ movq(dst, Immediate(imm));
} else {
- __ LoadObject(dst, value->AsConstant()->instance());
+ __ LoadObject(dst, value->AsConstant()->value());
}
} else {
ASSERT(value->IsTemp());
@@ -332,6 +332,18 @@
}
+void FlowGraphCompiler::VisitAllocateObject(AllocateObjectComp* comp) {
+ const Class& cls = Class::ZoneHandle(comp->constructor().owner());
+ const bool requires_type_arguments = cls.HasTypeArguments();
+ const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls));
+ const ExternalLabel label(cls.ToCString(), stub.EntryPoint());
+ GenerateCall(comp->token_index(), &label, PcDescriptors::kOther);
+ for (intptr_t i = 0; i < comp->arguments().length(); i++) {
+ __ popq(RCX); // Discard allocation argument
+ }
+}
+
+
void FlowGraphCompiler::VisitCreateArray(CreateArrayComp* comp) {
// 1. Allocate the array. R10 = length, RBX = element type.
__ movq(R10, Immediate(Smi::RawValue(comp->ElementCount())));
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698