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

Side by Side Diff: src/hydrogen-instructions.h

Issue 9304001: Implement inlining of constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed moar comments by Vyacheslav Egorov. Created 8 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 | « src/hydrogen.cc ('k') | src/hydrogen-instructions.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \ 55 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
56 V(BitwiseBinaryOperation) \ 56 V(BitwiseBinaryOperation) \
57 V(ControlInstruction) \ 57 V(ControlInstruction) \
58 V(Instruction) \ 58 V(Instruction) \
59 59
60 60
61 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ 61 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
62 V(AbnormalExit) \ 62 V(AbnormalExit) \
63 V(AccessArgumentsAt) \ 63 V(AccessArgumentsAt) \
64 V(Add) \ 64 V(Add) \
65 V(AllocateObject) \
65 V(ApplyArguments) \ 66 V(ApplyArguments) \
66 V(ArgumentsElements) \ 67 V(ArgumentsElements) \
67 V(ArgumentsLength) \ 68 V(ArgumentsLength) \
68 V(ArgumentsObject) \ 69 V(ArgumentsObject) \
69 V(ArrayLiteral) \ 70 V(ArrayLiteral) \
70 V(Bitwise) \ 71 V(Bitwise) \
71 V(BitNot) \ 72 V(BitNot) \
72 V(BlockEntry) \ 73 V(BlockEntry) \
73 V(BoundsCheck) \ 74 V(BoundsCheck) \
74 V(Branch) \ 75 V(Branch) \
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 private: 1337 private:
1337 Type type_; 1338 Type type_;
1338 }; 1339 };
1339 1340
1340 1341
1341 class HEnterInlined: public HTemplateInstruction<0> { 1342 class HEnterInlined: public HTemplateInstruction<0> {
1342 public: 1343 public:
1343 HEnterInlined(Handle<JSFunction> closure, 1344 HEnterInlined(Handle<JSFunction> closure,
1344 int arguments_count, 1345 int arguments_count,
1345 FunctionLiteral* function, 1346 FunctionLiteral* function,
1346 CallKind call_kind) 1347 CallKind call_kind,
1348 bool is_construct)
1347 : closure_(closure), 1349 : closure_(closure),
1348 arguments_count_(arguments_count), 1350 arguments_count_(arguments_count),
1349 function_(function), 1351 function_(function),
1350 call_kind_(call_kind) { 1352 call_kind_(call_kind),
1353 is_construct_(is_construct) {
1351 } 1354 }
1352 1355
1353 virtual void PrintDataTo(StringStream* stream); 1356 virtual void PrintDataTo(StringStream* stream);
1354 1357
1355 Handle<JSFunction> closure() const { return closure_; } 1358 Handle<JSFunction> closure() const { return closure_; }
1356 int arguments_count() const { return arguments_count_; } 1359 int arguments_count() const { return arguments_count_; }
1357 FunctionLiteral* function() const { return function_; } 1360 FunctionLiteral* function() const { return function_; }
1358 CallKind call_kind() const { return call_kind_; } 1361 CallKind call_kind() const { return call_kind_; }
1362 bool is_construct() const { return is_construct_; }
1359 1363
1360 virtual Representation RequiredInputRepresentation(int index) { 1364 virtual Representation RequiredInputRepresentation(int index) {
1361 return Representation::None(); 1365 return Representation::None();
1362 } 1366 }
1363 1367
1364 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) 1368 DECLARE_CONCRETE_INSTRUCTION(EnterInlined)
1365 1369
1366 private: 1370 private:
1367 Handle<JSFunction> closure_; 1371 Handle<JSFunction> closure_;
1368 int arguments_count_; 1372 int arguments_count_;
1369 FunctionLiteral* function_; 1373 FunctionLiteral* function_;
1370 CallKind call_kind_; 1374 CallKind call_kind_;
1375 bool is_construct_;
1371 }; 1376 };
1372 1377
1373 1378
1374 class HLeaveInlined: public HTemplateInstruction<0> { 1379 class HLeaveInlined: public HTemplateInstruction<0> {
1375 public: 1380 public:
1376 HLeaveInlined() {} 1381 HLeaveInlined() {}
1377 1382
1378 virtual Representation RequiredInputRepresentation(int index) { 1383 virtual Representation RequiredInputRepresentation(int index) {
1379 return Representation::None(); 1384 return Representation::None();
1380 } 1385 }
(...skipping 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after
4266 4271
4267 protected: 4272 protected:
4268 virtual bool DataEquals(HValue* other) { return true; } 4273 virtual bool DataEquals(HValue* other) { return true; }
4269 4274
4270 virtual Range* InferRange() { 4275 virtual Range* InferRange() {
4271 return new Range(0, String::kMaxLength); 4276 return new Range(0, String::kMaxLength);
4272 } 4277 }
4273 }; 4278 };
4274 4279
4275 4280
4281 class HAllocateObject: public HTemplateInstruction<1> {
4282 public:
4283 HAllocateObject(HValue* context, Handle<JSFunction> constructor)
4284 : constructor_(constructor) {
4285 SetOperandAt(0, context);
4286 set_representation(Representation::Tagged());
4287 }
4288
4289 HValue* context() { return OperandAt(0); }
4290 Handle<JSFunction> constructor() { return constructor_; }
4291
4292 virtual Representation RequiredInputRepresentation(int index) {
4293 return Representation::Tagged();
4294 }
4295 virtual HType CalculateInferredType();
4296
4297 DECLARE_CONCRETE_INSTRUCTION(AllocateObject)
4298
4299 private:
4300 Handle<JSFunction> constructor_;
4301 };
4302
4303
4276 template <int V> 4304 template <int V>
4277 class HMaterializedLiteral: public HTemplateInstruction<V> { 4305 class HMaterializedLiteral: public HTemplateInstruction<V> {
4278 public: 4306 public:
4279 HMaterializedLiteral<V>(int index, int depth) 4307 HMaterializedLiteral<V>(int index, int depth)
4280 : literal_index_(index), depth_(depth) { 4308 : literal_index_(index), depth_(depth) {
4281 this->set_representation(Representation::Tagged()); 4309 this->set_representation(Representation::Tagged());
4282 } 4310 }
4283 4311
4284 int literal_index() const { return literal_index_; } 4312 int literal_index() const { return literal_index_; }
4285 int depth() const { return depth_; } 4313 int depth() const { return depth_; }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
4558 4586
4559 DECLARE_CONCRETE_INSTRUCTION(In) 4587 DECLARE_CONCRETE_INSTRUCTION(In)
4560 }; 4588 };
4561 4589
4562 #undef DECLARE_INSTRUCTION 4590 #undef DECLARE_INSTRUCTION
4563 #undef DECLARE_CONCRETE_INSTRUCTION 4591 #undef DECLARE_CONCRETE_INSTRUCTION
4564 4592
4565 } } // namespace v8::internal 4593 } } // namespace v8::internal
4566 4594
4567 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4595 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698