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

Side by Side Diff: src/ia32/codegen-ia32.h

Issue 113259: Inline the code dealing with entering spilled scopes and maintaining a... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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/codegen-inl.h ('k') | src/ia32/codegen-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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 void DeleteFrame(); 315 void DeleteFrame();
316 316
317 RegisterAllocator* allocator() const { return allocator_; } 317 RegisterAllocator* allocator() const { return allocator_; }
318 318
319 CodeGenState* state() { return state_; } 319 CodeGenState* state() { return state_; }
320 void set_state(CodeGenState* state) { state_ = state; } 320 void set_state(CodeGenState* state) { state_ = state; }
321 321
322 void AddDeferred(DeferredCode* code) { deferred_.Add(code); } 322 void AddDeferred(DeferredCode* code) { deferred_.Add(code); }
323 323
324 #ifdef DEBUG
324 bool in_spilled_code() const { return in_spilled_code_; } 325 bool in_spilled_code() const { return in_spilled_code_; }
325 void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; } 326 void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; }
327 #endif
326 328
327 private: 329 private:
328 // Construction/Destruction 330 // Construction/Destruction
329 CodeGenerator(int buffer_size, Handle<Script> script, bool is_eval); 331 CodeGenerator(int buffer_size, Handle<Script> script, bool is_eval);
330 virtual ~CodeGenerator() { delete masm_; } 332 virtual ~CodeGenerator() { delete masm_; }
331 333
332 // Accessors 334 // Accessors
333 Scope* scope() const { return scope_; } 335 Scope* scope() const { return scope_; }
334 336
335 // Clearing and generating deferred code. 337 // Clearing and generating deferred code.
(...skipping 17 matching lines...) Expand all
353 355
354 #define DEF_VISIT(type) \ 356 #define DEF_VISIT(type) \
355 void Visit##type(type* node); 357 void Visit##type(type* node);
356 NODE_LIST(DEF_VISIT) 358 NODE_LIST(DEF_VISIT)
357 #undef DEF_VISIT 359 #undef DEF_VISIT
358 360
359 // Visit a statement and then spill the virtual frame if control flow can 361 // Visit a statement and then spill the virtual frame if control flow can
360 // reach the end of the statement (ie, it does not exit via break, 362 // reach the end of the statement (ie, it does not exit via break,
361 // continue, return, or throw). This function is used temporarily while 363 // continue, return, or throw). This function is used temporarily while
362 // the code generator is being transformed. 364 // the code generator is being transformed.
363 void VisitAndSpill(Statement* statement); 365 inline void VisitAndSpill(Statement* statement);
364 366
365 // Visit a list of statements and then spill the virtual frame if control 367 // Visit a list of statements and then spill the virtual frame if control
366 // flow can reach the end of the list. 368 // flow can reach the end of the list.
367 void VisitStatementsAndSpill(ZoneList<Statement*>* statements); 369 inline void VisitStatementsAndSpill(ZoneList<Statement*>* statements);
368 370
369 // Main code generation function 371 // Main code generation function
370 void GenCode(FunctionLiteral* fun); 372 void GenCode(FunctionLiteral* fun);
371 373
372 // Generate the return sequence code. Should be called no more than 374 // Generate the return sequence code. Should be called no more than
373 // once per compiled function, immediately after binding the return 375 // once per compiled function, immediately after binding the return
374 // target (which can not be done more than once). 376 // target (which can not be done more than once).
375 void GenerateReturnSequence(Result* return_value); 377 void GenerateReturnSequence(Result* return_value);
376 378
377 // The following are used by class Reference. 379 // The following are used by class Reference.
(...skipping 19 matching lines...) Expand all
397 TypeofState typeof_state, 399 TypeofState typeof_state,
398 ControlDestination* destination, 400 ControlDestination* destination,
399 bool force_control); 401 bool force_control);
400 void Load(Expression* x, TypeofState typeof_state = NOT_INSIDE_TYPEOF); 402 void Load(Expression* x, TypeofState typeof_state = NOT_INSIDE_TYPEOF);
401 void LoadGlobal(); 403 void LoadGlobal();
402 void LoadGlobalReceiver(); 404 void LoadGlobalReceiver();
403 405
404 // Generate code to push the value of an expression on top of the frame 406 // Generate code to push the value of an expression on top of the frame
405 // and then spill the frame fully to memory. This function is used 407 // and then spill the frame fully to memory. This function is used
406 // temporarily while the code generator is being transformed. 408 // temporarily while the code generator is being transformed.
407 void LoadAndSpill(Expression* expression, 409 inline void LoadAndSpill(Expression* expression,
408 TypeofState typeof_state = NOT_INSIDE_TYPEOF); 410 TypeofState typeof_state = NOT_INSIDE_TYPEOF);
409 411
410 // Read a value from a slot and leave it on top of the expression stack. 412 // Read a value from a slot and leave it on top of the expression stack.
411 void LoadFromSlot(Slot* slot, TypeofState typeof_state); 413 void LoadFromSlot(Slot* slot, TypeofState typeof_state);
412 Result LoadFromGlobalSlotCheckExtensions(Slot* slot, 414 Result LoadFromGlobalSlotCheckExtensions(Slot* slot,
413 TypeofState typeof_state, 415 TypeofState typeof_state,
414 JumpTarget* slow); 416 JumpTarget* slow);
415 417
416 // Store the value on top of the expression stack into a slot, leaving the 418 // Store the value on top of the expression stack into a slot, leaving the
417 // value in place. 419 // value in place.
418 void StoreToSlot(Slot* slot, InitState init_state); 420 void StoreToSlot(Slot* slot, InitState init_state);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 604
603 // Jump targets. 605 // Jump targets.
604 // The target of the return from the function. 606 // The target of the return from the function.
605 BreakTarget function_return_; 607 BreakTarget function_return_;
606 608
607 // True if the function return is shadowed (ie, jumping to the target 609 // True if the function return is shadowed (ie, jumping to the target
608 // function_return_ does not jump to the true function return, but rather 610 // function_return_ does not jump to the true function return, but rather
609 // to some unlinking code). 611 // to some unlinking code).
610 bool function_return_is_shadowed_; 612 bool function_return_is_shadowed_;
611 613
614 #ifdef DEBUG
612 // True when we are in code that expects the virtual frame to be fully 615 // True when we are in code that expects the virtual frame to be fully
613 // spilled. Some virtual frame function are disabled in DEBUG builds when 616 // spilled. Some virtual frame function are disabled in DEBUG builds when
614 // called from spilled code, because they do not leave the virtual frame 617 // called from spilled code, because they do not leave the virtual frame
615 // in a spilled state. 618 // in a spilled state.
616 bool in_spilled_code_; 619 bool in_spilled_code_;
Erik Corry 2009/05/14 09:15:10 Is it really worth having this only in debug build
620 #endif
617 621
618 static InlineRuntimeLUT kInlineRuntimeLUT[]; 622 static InlineRuntimeLUT kInlineRuntimeLUT[];
619 623
620 friend class VirtualFrame; 624 friend class VirtualFrame;
621 friend class JumpTarget; 625 friend class JumpTarget;
622 friend class Reference; 626 friend class Reference;
623 friend class Result; 627 friend class Result;
624 628
625 friend class CodeGeneratorPatcher; // Used in test-log-ia32.cc 629 friend class CodeGeneratorPatcher; // Used in test-log-ia32.cc
626 630
627 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); 631 DISALLOW_COPY_AND_ASSIGN(CodeGenerator);
628 }; 632 };
629 633
630 634
631 } } // namespace v8::internal 635 } } // namespace v8::internal
632 636
633 #endif // V8_IA32_CODEGEN_IA32_H_ 637 #endif // V8_IA32_CODEGEN_IA32_H_
OLDNEW
« no previous file with comments | « src/codegen-inl.h ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698