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

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

Issue 102063004: Introduce API to temporarily interrupt long running JavaScript code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 } 1238 }
1239 1239
1240 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } 1240 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
1241 1241
1242 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0; 1242 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
1243 1243
1244 #ifdef DEBUG 1244 #ifdef DEBUG
1245 virtual void Verify() V8_OVERRIDE; 1245 virtual void Verify() V8_OVERRIDE;
1246 #endif 1246 #endif
1247 1247
1248 virtual bool IsCall() { return false; } 1248 virtual bool HasStackCheck() { return false; }
1249 1249
1250 DECLARE_ABSTRACT_INSTRUCTION(Instruction) 1250 DECLARE_ABSTRACT_INSTRUCTION(Instruction)
1251 1251
1252 protected: 1252 protected:
1253 HInstruction(HType type = HType::Tagged()) 1253 HInstruction(HType type = HType::Tagged())
1254 : HValue(type), 1254 : HValue(type),
1255 next_(NULL), 1255 next_(NULL),
1256 previous_(NULL), 1256 previous_(NULL),
1257 position_(RelocInfo::kNoPosition) { 1257 position_(RelocInfo::kNoPosition) {
1258 SetGVNFlag(kDependsOnOsrEntries); 1258 SetGVNFlag(kDependsOnOsrEntries);
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 } 2236 }
2237 2237
2238 virtual int argument_count() const { 2238 virtual int argument_count() const {
2239 return argument_count_; 2239 return argument_count_;
2240 } 2240 }
2241 2241
2242 virtual int argument_delta() const V8_OVERRIDE { 2242 virtual int argument_delta() const V8_OVERRIDE {
2243 return -argument_count(); 2243 return -argument_count();
2244 } 2244 }
2245 2245
2246 virtual bool IsCall() V8_FINAL V8_OVERRIDE { return true; }
2247
2248 private: 2246 private:
2249 int argument_count_; 2247 int argument_count_;
2250 }; 2248 };
2251 2249
2252 2250
2253 class HUnaryCall : public HCall<1> { 2251 class HUnaryCall : public HCall<1> {
2254 public: 2252 public:
2255 HUnaryCall(HValue* value, int argument_count) 2253 HUnaryCall(HValue* value, int argument_count)
2256 : HCall<1>(argument_count) { 2254 : HCall<1>(argument_count) {
2257 SetOperandAt(0, value); 2255 SetOperandAt(0, value);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2309 int argument_count) { 2307 int argument_count) {
2310 return new(zone) HInvokeFunction(context, function, 2308 return new(zone) HInvokeFunction(context, function,
2311 known_function, argument_count); 2309 known_function, argument_count);
2312 } 2310 }
2313 2311
2314 HValue* context() { return first(); } 2312 HValue* context() { return first(); }
2315 HValue* function() { return second(); } 2313 HValue* function() { return second(); }
2316 Handle<JSFunction> known_function() { return known_function_; } 2314 Handle<JSFunction> known_function() { return known_function_; }
2317 int formal_parameter_count() const { return formal_parameter_count_; } 2315 int formal_parameter_count() const { return formal_parameter_count_; }
2318 2316
2317 virtual bool HasStackCheck() V8_FINAL V8_OVERRIDE {
2318 return !known_function().is_null() &&
2319 (known_function()->code()->kind() == Code::FUNCTION ||
2320 known_function()->code()->kind() == Code::OPTIMIZED_FUNCTION);
2321 }
2322
2319 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction) 2323 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction)
2320 2324
2321 private: 2325 private:
2322 HInvokeFunction(HValue* context, HValue* function, int argument_count) 2326 HInvokeFunction(HValue* context, HValue* function, int argument_count)
2323 : HBinaryCall(context, function, argument_count) { 2327 : HBinaryCall(context, function, argument_count) {
2324 } 2328 }
2325 2329
2326 Handle<JSFunction> known_function_; 2330 Handle<JSFunction> known_function_;
2327 int formal_parameter_count_; 2331 int formal_parameter_count_;
2328 }; 2332 };
(...skipping 12 matching lines...) Expand all
2341 return function_->code() == 2345 return function_->code() ==
2342 function_->GetIsolate()->builtins()->builtin(Builtins::kFunctionApply); 2346 function_->GetIsolate()->builtins()->builtin(Builtins::kFunctionApply);
2343 } 2347 }
2344 2348
2345 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 2349 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2346 2350
2347 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 2351 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
2348 return Representation::None(); 2352 return Representation::None();
2349 } 2353 }
2350 2354
2355 virtual bool HasStackCheck() V8_FINAL V8_OVERRIDE {
2356 return (function()->code()->kind() == Code::FUNCTION ||
2357 function()->code()->kind() == Code::OPTIMIZED_FUNCTION);
2358 }
2359
2351 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction) 2360 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction)
2352 2361
2353 private: 2362 private:
2354 HCallConstantFunction(Handle<JSFunction> function, int argument_count) 2363 HCallConstantFunction(Handle<JSFunction> function, int argument_count)
2355 : HCall<0>(argument_count), 2364 : HCall<0>(argument_count),
2356 function_(function), 2365 function_(function),
2357 formal_parameter_count_(function->shared()->formal_parameter_count()) {} 2366 formal_parameter_count_(function->shared()->formal_parameter_count()) {}
2358 2367
2359 Handle<JSFunction> function_; 2368 Handle<JSFunction> function_;
2360 int formal_parameter_count_; 2369 int formal_parameter_count_;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
2458 2467
2459 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 2468 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2460 2469
2461 Handle<JSFunction> target() const { return target_; } 2470 Handle<JSFunction> target() const { return target_; }
2462 int formal_parameter_count() const { return formal_parameter_count_; } 2471 int formal_parameter_count() const { return formal_parameter_count_; }
2463 2472
2464 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 2473 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
2465 return Representation::None(); 2474 return Representation::None();
2466 } 2475 }
2467 2476
2477 virtual bool HasStackCheck() V8_FINAL V8_OVERRIDE {
2478 return (target()->code()->kind() == Code::FUNCTION ||
2479 target()->code()->kind() == Code::OPTIMIZED_FUNCTION);
2480 }
2481
2468 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal) 2482 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal)
2469 2483
2470 private: 2484 private:
2471 HCallKnownGlobal(Handle<JSFunction> target, int argument_count) 2485 HCallKnownGlobal(Handle<JSFunction> target, int argument_count)
2472 : HCall<0>(argument_count), 2486 : HCall<0>(argument_count),
2473 target_(target), 2487 target_(target),
2474 formal_parameter_count_(target->shared()->formal_parameter_count()) { } 2488 formal_parameter_count_(target->shared()->formal_parameter_count()) { }
2475 2489
2476 Handle<JSFunction> target_; 2490 Handle<JSFunction> target_;
2477 int formal_parameter_count_; 2491 int formal_parameter_count_;
(...skipping 5008 matching lines...) Expand 10 before | Expand all | Expand 10 after
7486 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7500 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7487 }; 7501 };
7488 7502
7489 7503
7490 #undef DECLARE_INSTRUCTION 7504 #undef DECLARE_INSTRUCTION
7491 #undef DECLARE_CONCRETE_INSTRUCTION 7505 #undef DECLARE_CONCRETE_INSTRUCTION
7492 7506
7493 } } // namespace v8::internal 7507 } } // namespace v8::internal
7494 7508
7495 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7509 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | src/hydrogen-sce.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698