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

Side by Side Diff: src/objects.h

Issue 6524006: Strict mode function entry (Function.prototype.call/apply) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix presubmit. Created 9 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/ia32/builtins-ia32.cc ('k') | src/x64/builtins-x64.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 4352 matching lines...) Expand 10 before | Expand all | Expand 10 after
4363 #else 4363 #else
4364 #error Unknown byte ordering 4364 #error Unknown byte ordering
4365 #endif 4365 #endif
4366 4366
4367 static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize); 4367 static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize);
4368 4368
4369 typedef FixedBodyDescriptor<kNameOffset, 4369 typedef FixedBodyDescriptor<kNameOffset,
4370 kThisPropertyAssignmentsOffset + kPointerSize, 4370 kThisPropertyAssignmentsOffset + kPointerSize,
4371 kSize> BodyDescriptor; 4371 kSize> BodyDescriptor;
4372 4372
4373 private:
4374 // Bit positions in start_position_and_type. 4373 // Bit positions in start_position_and_type.
4375 // The source code start position is in the 30 most significant bits of 4374 // The source code start position is in the 30 most significant bits of
4376 // the start_position_and_type field. 4375 // the start_position_and_type field.
4377 static const int kIsExpressionBit = 0; 4376 static const int kIsExpressionBit = 0;
4378 static const int kIsTopLevelBit = 1; 4377 static const int kIsTopLevelBit = 1;
4379 static const int kStartPositionShift = 2; 4378 static const int kStartPositionShift = 2;
4380 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); 4379 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
4381 4380
4382 // Bit positions in compiler_hints. 4381 // Bit positions in compiler_hints.
4383 static const int kHasOnlySimpleThisPropertyAssignments = 0; 4382 static const int kHasOnlySimpleThisPropertyAssignments = 0;
4384 static const int kTryFullCodegen = 1; 4383 static const int kTryFullCodegen = 1;
4385 static const int kAllowLazyCompilation = 2; 4384 static const int kAllowLazyCompilation = 2;
4386 static const int kLiveObjectsMayExist = 3; 4385 static const int kLiveObjectsMayExist = 3;
4387 static const int kCodeAgeShift = 4; 4386 static const int kCodeAgeShift = 4;
4388 static const int kCodeAgeMask = 0x7; 4387 static const int kCodeAgeMask = 0x7;
4389 static const int kOptimizationDisabled = 7; 4388 static const int kOptimizationDisabled = 7;
4390 static const int kStrictModeFunction = 8; 4389 static const int kStrictModeFunction = 8;
4391 4390
4391 private:
4392 #if V8_HOST_ARCH_32_BIT
4393 // On 32 bit platforms, compiler hints is a smi.
4394 static const int kCompilerHintsSmiTagSize = kSmiTagSize;
4395 static const int kCompilerHintsSize = kPointerSize;
4396 #else
4397 // On 64 bit platforms, compiler hints is not a smi, see comment above.
4398 static const int kCompilerHintsSmiTagSize = 0;
4399 static const int kCompilerHintsSize = kIntSize;
4400 #endif
4401
4402 public:
4403 // Constants for optimizing codegen for strict mode function tests.
4404 // Allows to use byte-widgh instructions.
4405 static const int kStrictModeBitWithinByte =
4406 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte;
4407
4408 #if __BYTE_ORDER == __LITTLE_ENDIAN
4409 static const int kStrictModeByteOffset = kCompilerHintsOffset +
4410 (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte;
4411 #elif __BYTE_ORDER == __BIG_ENDIAN
4412 static const int kStrictModeByteOffset = kCompilerHintsOffset +
4413 (kCompilerHintsSize - 1) -
4414 ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte);
4415 #else
4416 #error Unknown byte ordering
4417 #endif
4418
4419 private:
4392 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); 4420 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo);
4393 }; 4421 };
4394 4422
4395 4423
4396 // JSFunction describes JavaScript functions. 4424 // JSFunction describes JavaScript functions.
4397 class JSFunction: public JSObject { 4425 class JSFunction: public JSObject {
4398 public: 4426 public:
4399 // [prototype_or_initial_map]: 4427 // [prototype_or_initial_map]:
4400 DECL_ACCESSORS(prototype_or_initial_map, Object) 4428 DECL_ACCESSORS(prototype_or_initial_map, Object)
4401 4429
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after
6525 } else { 6553 } else {
6526 value &= ~(1 << bit_position); 6554 value &= ~(1 << bit_position);
6527 } 6555 }
6528 return value; 6556 return value;
6529 } 6557 }
6530 }; 6558 };
6531 6559
6532 } } // namespace v8::internal 6560 } } // namespace v8::internal
6533 6561
6534 #endif // V8_OBJECTS_H_ 6562 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698