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

Side by Side Diff: src/ia32/macro-assembler-ia32.h

Issue 7348008: Merge up to 8597 to experimental/gc from the bleeding edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 5 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/ia32/lithium-ia32.cc ('k') | src/ia32/macro-assembler-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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // Setup call kind marking in ecx. The method takes ecx as an 250 // Setup call kind marking in ecx. The method takes ecx as an
251 // explicit first parameter to make the code more readable at the 251 // explicit first parameter to make the code more readable at the
252 // call sites. 252 // call sites.
253 void SetCallKind(Register dst, CallKind kind); 253 void SetCallKind(Register dst, CallKind kind);
254 254
255 // Invoke the JavaScript function code by either calling or jumping. 255 // Invoke the JavaScript function code by either calling or jumping.
256 void InvokeCode(const Operand& code, 256 void InvokeCode(const Operand& code,
257 const ParameterCount& expected, 257 const ParameterCount& expected,
258 const ParameterCount& actual, 258 const ParameterCount& actual,
259 InvokeFlag flag, 259 InvokeFlag flag,
260 const CallWrapper& call_wrapper = NullCallWrapper(), 260 const CallWrapper& call_wrapper,
261 CallKind call_kind = CALL_AS_METHOD); 261 CallKind call_kind);
262 262
263 void InvokeCode(Handle<Code> code, 263 void InvokeCode(Handle<Code> code,
264 const ParameterCount& expected, 264 const ParameterCount& expected,
265 const ParameterCount& actual, 265 const ParameterCount& actual,
266 RelocInfo::Mode rmode, 266 RelocInfo::Mode rmode,
267 InvokeFlag flag, 267 InvokeFlag flag,
268 const CallWrapper& call_wrapper = NullCallWrapper(), 268 const CallWrapper& call_wrapper,
269 CallKind call_kind = CALL_AS_METHOD); 269 CallKind call_kind);
270 270
271 // Invoke the JavaScript function in the given register. Changes the 271 // Invoke the JavaScript function in the given register. Changes the
272 // current context to the context in the function before invoking. 272 // current context to the context in the function before invoking.
273 void InvokeFunction(Register function, 273 void InvokeFunction(Register function,
274 const ParameterCount& actual, 274 const ParameterCount& actual,
275 InvokeFlag flag, 275 InvokeFlag flag,
276 const CallWrapper& call_wrapper = NullCallWrapper(), 276 const CallWrapper& call_wrapper,
277 CallKind call_kind = CALL_AS_METHOD); 277 CallKind call_kind);
278 278
279 void InvokeFunction(JSFunction* function, 279 void InvokeFunction(JSFunction* function,
280 const ParameterCount& actual, 280 const ParameterCount& actual,
281 InvokeFlag flag, 281 InvokeFlag flag,
282 const CallWrapper& call_wrapper = NullCallWrapper()); 282 const CallWrapper& call_wrapper,
283 CallKind call_kind);
283 284
284 // Invoke specified builtin JavaScript function. Adds an entry to 285 // Invoke specified builtin JavaScript function. Adds an entry to
285 // the unresolved list if the name does not resolve. 286 // the unresolved list if the name does not resolve.
286 void InvokeBuiltin(Builtins::JavaScript id, 287 void InvokeBuiltin(Builtins::JavaScript id,
287 InvokeFlag flag, 288 InvokeFlag flag,
288 const CallWrapper& call_wrapper = NullCallWrapper()); 289 const CallWrapper& call_wrapper = NullCallWrapper());
289 290
290 // Store the function for the given builtin in the target register. 291 // Store the function for the given builtin in the target register.
291 void GetBuiltinFunction(Register target, Builtins::JavaScript id); 292 void GetBuiltinFunction(Register target, Builtins::JavaScript id);
292 293
293 // Store the code object for the given builtin in the target register. 294 // Store the code object for the given builtin in the target register.
294 void GetBuiltinEntry(Register target, Builtins::JavaScript id); 295 void GetBuiltinEntry(Register target, Builtins::JavaScript id);
295 296
296 // Expression support 297 // Expression support
297 void Set(Register dst, const Immediate& x); 298 void Set(Register dst, const Immediate& x);
298 void Set(const Operand& dst, const Immediate& x); 299 void Set(const Operand& dst, const Immediate& x);
299 300
300 // Support for constant splitting. 301 // Support for constant splitting.
301 bool IsUnsafeImmediate(const Immediate& x); 302 bool IsUnsafeImmediate(const Immediate& x);
302 void SafeSet(Register dst, const Immediate& x); 303 void SafeSet(Register dst, const Immediate& x);
303 void SafePush(const Immediate& x); 304 void SafePush(const Immediate& x);
304 305
305 // Compare object type for heap object. 306 // Compare object type for heap object.
306 // Incoming register is heap_object and outgoing register is map. 307 // Incoming register is heap_object and outgoing register is map.
307 void CmpObjectType(Register heap_object, InstanceType type, Register map); 308 void CmpObjectType(Register heap_object, InstanceType type, Register map);
308 309
309 // Compare instance type for map. 310 // Compare instance type for map.
310 void CmpInstanceType(Register map, InstanceType type); 311 void CmpInstanceType(Register map, InstanceType type);
311 312
313 // Check if a map for a JSObject indicates that the object has fast elements.
314 // Jump to the specified label if it does not.
315 void CheckFastElements(Register map,
316 Label* fail,
317 Label::Distance distance = Label::kFar);
318
312 // Check if the map of an object is equal to a specified map and branch to 319 // Check if the map of an object is equal to a specified map and branch to
313 // label if not. Skip the smi check if not required (object is known to be a 320 // label if not. Skip the smi check if not required (object is known to be a
314 // heap object) 321 // heap object)
315 void CheckMap(Register obj, 322 void CheckMap(Register obj,
316 Handle<Map> map, 323 Handle<Map> map,
317 Label* fail, 324 Label* fail,
318 SmiCheckType smi_check_type); 325 SmiCheckType smi_check_type);
319 326
320 // Check if the map of an object is equal to a specified map and branch to a 327 // Check if the map of an object is equal to a specified map and branch to a
321 // specified target if equal. Skip the smi check if not required (object is 328 // specified target if equal. Skip the smi check if not required (object is
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 j(not_carry, is_smi); 382 j(not_carry, is_smi);
376 } 383 }
377 384
378 // Jump the register contains a smi. 385 // Jump the register contains a smi.
379 inline void JumpIfSmi(Register value, 386 inline void JumpIfSmi(Register value,
380 Label* smi_label, 387 Label* smi_label,
381 Label::Distance distance = Label::kFar) { 388 Label::Distance distance = Label::kFar) {
382 test(value, Immediate(kSmiTagMask)); 389 test(value, Immediate(kSmiTagMask));
383 j(zero, smi_label, distance); 390 j(zero, smi_label, distance);
384 } 391 }
392 // Jump if the operand is a smi.
393 inline void JumpIfSmi(Operand value,
394 Label* smi_label,
395 Label::Distance distance = Label::kFar) {
396 test(value, Immediate(kSmiTagMask));
397 j(zero, smi_label, distance);
398 }
385 // Jump if register contain a non-smi. 399 // Jump if register contain a non-smi.
386 inline void JumpIfNotSmi(Register value, Label* not_smi_label) { 400 inline void JumpIfNotSmi(Register value,
401 Label* not_smi_label,
402 Label::Distance distance = Label::kFar) {
387 test(value, Immediate(kSmiTagMask)); 403 test(value, Immediate(kSmiTagMask));
388 j(not_zero, not_smi_label); 404 j(not_zero, not_smi_label, distance);
389 } 405 }
390 406
391 void LoadInstanceDescriptors(Register map, Register descriptors); 407 void LoadInstanceDescriptors(Register map, Register descriptors);
392 408
393 void LoadPowerOf2(XMMRegister dst, Register scratch, int power); 409 void LoadPowerOf2(XMMRegister dst, Register scratch, int power);
394 410
395 // Abort execution if argument is not a number. Used in debug code. 411 // Abort execution if argument is not a number. Used in debug code.
396 void AbortIfNotNumber(Register object); 412 void AbortIfNotNumber(Register object);
397 413
398 // Abort execution if argument is not a smi. Used in debug code. 414 // Abort execution if argument is not a smi. Used in debug code.
(...skipping 24 matching lines...) Expand all
423 // Inline caching support 439 // Inline caching support
424 440
425 // Generate code for checking access rights - used for security checks 441 // Generate code for checking access rights - used for security checks
426 // on access to global objects across environments. The holder register 442 // on access to global objects across environments. The holder register
427 // is left untouched, but the scratch register is clobbered. 443 // is left untouched, but the scratch register is clobbered.
428 void CheckAccessGlobalProxy(Register holder_reg, 444 void CheckAccessGlobalProxy(Register holder_reg,
429 Register scratch, 445 Register scratch,
430 Label* miss); 446 Label* miss);
431 447
432 448
449 void LoadFromNumberDictionary(Label* miss,
450 Register elements,
451 Register key,
452 Register r0,
453 Register r1,
454 Register r2,
455 Register result);
456
457
433 // --------------------------------------------------------------------------- 458 // ---------------------------------------------------------------------------
434 // Allocation support 459 // Allocation support
435 460
436 // Allocate an object in new space. If the new space is exhausted control 461 // Allocate an object in new space. If the new space is exhausted control
437 // continues at the gc_required label. The allocated object is returned in 462 // continues at the gc_required label. The allocated object is returned in
438 // result and end of the new object is returned in result_end. The register 463 // result and end of the new object is returned in result_end. The register
439 // scratch can be passed as no_reg in which case an additional object 464 // scratch can be passed as no_reg in which case an additional object
440 // reference will be added to the reloc info. The returned pointers in result 465 // reference will be added to the reloc info. The returned pointers in result
441 // and result_end have not yet been tagged as heap objects. If 466 // and result_end have not yet been tagged as heap objects. If
442 // result_contains_top_on_entry is true the content of result is known to be 467 // result_contains_top_on_entry is true the content of result is known to be
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 // Calls a C function and cleans up the space for arguments allocated 654 // Calls a C function and cleans up the space for arguments allocated
630 // by PrepareCallCFunction. The called function is not allowed to trigger a 655 // by PrepareCallCFunction. The called function is not allowed to trigger a
631 // garbage collection, since that might move the code and invalidate the 656 // garbage collection, since that might move the code and invalidate the
632 // return address (unless this is somehow accounted for by the called 657 // return address (unless this is somehow accounted for by the called
633 // function). 658 // function).
634 void CallCFunction(ExternalReference function, int num_arguments); 659 void CallCFunction(ExternalReference function, int num_arguments);
635 void CallCFunction(Register function, int num_arguments); 660 void CallCFunction(Register function, int num_arguments);
636 661
637 // Prepares stack to put arguments (aligns and so on). Reserves 662 // Prepares stack to put arguments (aligns and so on). Reserves
638 // space for return value if needed (assumes the return value is a handle). 663 // space for return value if needed (assumes the return value is a handle).
639 // Uses callee-saved esi to restore stack state after call. Arguments must be 664 // Arguments must be stored in ApiParameterOperand(0), ApiParameterOperand(1)
640 // stored in ApiParameterOperand(0), ApiParameterOperand(1) etc. Saves 665 // etc. Saves context (esi). If space was reserved for return value then
641 // context (esi). 666 // stores the pointer to the reserved slot into esi.
642 void PrepareCallApiFunction(int argc, Register scratch); 667 void PrepareCallApiFunction(int argc);
643 668
644 // Calls an API function. Allocates HandleScope, extracts 669 // Calls an API function. Allocates HandleScope, extracts
645 // returned value from handle and propagates exceptions. 670 // returned value from handle and propagates exceptions.
646 // Clobbers ebx, edi and caller-save registers. Restores context. 671 // Clobbers ebx, edi and caller-save registers. Restores context.
647 // On return removes stack_space * kPointerSize (GCed). 672 // On return removes stack_space * kPointerSize (GCed).
648 MaybeObject* TryCallApiFunctionAndReturn(ApiFunction* function, 673 MaybeObject* TryCallApiFunctionAndReturn(ApiFunction* function,
649 int stack_space); 674 int stack_space);
650 675
651 // Jump to a runtime routine. 676 // Jump to a runtime routine.
652 void JumpToExternalReference(const ExternalReference& ext); 677 void JumpToExternalReference(const ExternalReference& ext);
(...skipping 20 matching lines...) Expand all
673 void CallSelf() { 698 void CallSelf() {
674 Handle<Code> self(reinterpret_cast<Code**>(CodeObject().location())); 699 Handle<Code> self(reinterpret_cast<Code**>(CodeObject().location()));
675 call(self, RelocInfo::CODE_TARGET); 700 call(self, RelocInfo::CODE_TARGET);
676 } 701 }
677 702
678 // Move if the registers are not identical. 703 // Move if the registers are not identical.
679 void Move(Register target, Register source); 704 void Move(Register target, Register source);
680 705
681 void Move(Register target, Handle<Object> value); 706 void Move(Register target, Handle<Object> value);
682 707
708 // Push a handle value.
709 void Push(Handle<Object> handle) { push(handle); }
710
683 Handle<Object> CodeObject() { 711 Handle<Object> CodeObject() {
684 ASSERT(!code_object_.is_null()); 712 ASSERT(!code_object_.is_null());
685 return code_object_; 713 return code_object_;
686 } 714 }
687 715
688 716
689 // --------------------------------------------------------------------------- 717 // ---------------------------------------------------------------------------
690 // StatsCounter support 718 // StatsCounter support
691 719
692 void SetCounter(StatsCounter* counter, int value); 720 void SetCounter(StatsCounter* counter, int value);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 } \ 904 } \
877 masm-> 905 masm->
878 #else 906 #else
879 #define ACCESS_MASM(masm) masm-> 907 #define ACCESS_MASM(masm) masm->
880 #endif 908 #endif
881 909
882 910
883 } } // namespace v8::internal 911 } } // namespace v8::internal
884 912
885 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 913 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698