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

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

Issue 23537067: Add support for keyed-call on arrays of fast elements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM port and clean up frameless SP-relative argument fetching Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/code-stubs-ia32.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 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2279 2279
2280 private: 2280 private:
2281 HCallNamed(HValue* context, Handle<String> name, int argument_count) 2281 HCallNamed(HValue* context, Handle<String> name, int argument_count)
2282 : HUnaryCall(context, argument_count), name_(name) { 2282 : HUnaryCall(context, argument_count), name_(name) {
2283 } 2283 }
2284 2284
2285 Handle<String> name_; 2285 Handle<String> name_;
2286 }; 2286 };
2287 2287
2288 2288
2289 enum CallMode {
2290 NORMAL_CALL,
2291 TAIL_CALL
2292 };
2293
2294
2289 class HCallFunction V8_FINAL : public HBinaryCall { 2295 class HCallFunction V8_FINAL : public HBinaryCall {
2290 public: 2296 public:
2291 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int); 2297 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int);
2298 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(
2299 HCallFunction, HValue*, int, CallMode);
2300
2301 bool IsTailCall() const { return call_mode_ == TAIL_CALL; }
2292 2302
2293 HValue* context() { return first(); } 2303 HValue* context() { return first(); }
2294 HValue* function() { return second(); } 2304 HValue* function() { return second(); }
2295 2305
2296 DECLARE_CONCRETE_INSTRUCTION(CallFunction) 2306 DECLARE_CONCRETE_INSTRUCTION(CallFunction)
2297 2307
2308 virtual int argument_delta() const V8_OVERRIDE {
2309 if (IsTailCall()) return 0;
2310 return -argument_count();
2311 }
2312
2298 private: 2313 private:
2299 HCallFunction(HValue* context, HValue* function, int argument_count) 2314 HCallFunction(HValue* context,
2300 : HBinaryCall(context, function, argument_count) { 2315 HValue* function,
2316 int argument_count,
2317 CallMode mode = NORMAL_CALL)
2318 : HBinaryCall(context, function, argument_count), call_mode_(mode) {
2301 } 2319 }
2320 CallMode call_mode_;
2302 }; 2321 };
2303 2322
2304 2323
2305 class HCallGlobal V8_FINAL : public HUnaryCall { 2324 class HCallGlobal V8_FINAL : public HUnaryCall {
2306 public: 2325 public:
2307 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallGlobal, Handle<String>, int); 2326 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallGlobal, Handle<String>, int);
2308 2327
2309 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 2328 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2310 2329
2311 HValue* context() { return value(); } 2330 HValue* context() { return value(); }
(...skipping 4861 matching lines...) Expand 10 before | Expand all | Expand 10 after
7173 virtual HType CalculateInferredType() V8_OVERRIDE { 7192 virtual HType CalculateInferredType() V8_OVERRIDE {
7174 return HType::Tagged(); 7193 return HType::Tagged();
7175 } 7194 }
7176 7195
7177 HValue* value() { return OperandAt(0); } 7196 HValue* value() { return OperandAt(0); }
7178 HValue* map() { return OperandAt(1); } 7197 HValue* map() { return OperandAt(1); }
7179 7198
7180 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue) 7199 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue)
7181 7200
7182 protected: 7201 protected:
7202 virtual int RedefinedOperandIndex() { return 0; }
7203
7183 virtual bool DataEquals(HValue* other) V8_OVERRIDE { 7204 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
7184 return true; 7205 return true;
7185 } 7206 }
7186 7207
7187 private: 7208 private:
7188 HCheckMapValue(HValue* value, 7209 HCheckMapValue(HValue* value,
7189 HValue* map) { 7210 HValue* map) {
7190 SetOperandAt(0, value); 7211 SetOperandAt(0, value);
7191 SetOperandAt(1, map); 7212 SetOperandAt(1, map);
7192 set_representation(Representation::Tagged()); 7213 set_representation(Representation::Tagged());
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
7297 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7318 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7298 }; 7319 };
7299 7320
7300 7321
7301 #undef DECLARE_INSTRUCTION 7322 #undef DECLARE_INSTRUCTION
7302 #undef DECLARE_CONCRETE_INSTRUCTION 7323 #undef DECLARE_CONCRETE_INSTRUCTION
7303 7324
7304 } } // namespace v8::internal 7325 } } // namespace v8::internal
7305 7326
7306 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7327 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698