Skip to content

Commit bcf163d

Browse files
committed
Upgrade V8 to 2.1.1
1 parent 7647835 commit bcf163d

File tree

213 files changed

+23731
-4858
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+23731
-4858
lines changed

deps/v8/AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Name/Organization <email address>
55

66
Google Inc.
7+
Sigma Designs Inc.
78

89
Alexander Botero-Lowry <[email protected]>
910
Alexandre Vassalotti <[email protected]>
@@ -22,3 +23,4 @@ Rene Rebe <[email protected]>
2223
Ryan Dahl <[email protected]>
2324
Patrick Gansterer <[email protected]>
2425
Subrato K De <[email protected]>
26+
Dineel D Sule <[email protected]>

deps/v8/ChangeLog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2010-02-19: Version 2.1.1
2+
3+
[ES5] Implemented Object.defineProperty.
4+
5+
Improved profiler support.
6+
7+
Added SetPrototype method in the public V8 API.
8+
9+
Added GetScriptOrigin and GetScriptLineNumber methods to Function
10+
objects in the API.
11+
12+
Performance improvements on all platforms.
13+
14+
115
2010-02-03: Version 2.1.0
216

317
Values are now always wrapped in objects when used as a receiver.

deps/v8/SConstruct

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,17 @@ LIBRARY_FLAGS = {
191191
'armvariant:arm': {
192192
'CPPDEFINES': ['V8_ARM_VARIANT_ARM']
193193
},
194+
'arch:mips': {
195+
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
196+
'simulator:none': {
197+
'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'],
198+
'LDFLAGS': ['-EL']
199+
}
200+
},
201+
'simulator:mips': {
202+
'CCFLAGS': ['-m32'],
203+
'LINKFLAGS': ['-m32']
204+
},
194205
'arch:x64': {
195206
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
196207
'CCFLAGS': ['-m64'],
@@ -292,6 +303,9 @@ V8_EXTRA_FLAGS = {
292303
# used by the arm simulator.
293304
'WARNINGFLAGS': ['/wd4996']
294305
},
306+
'arch:mips': {
307+
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
308+
},
295309
'disassembler:on': {
296310
'CPPDEFINES': ['ENABLE_DISASSEMBLER']
297311
}
@@ -457,10 +471,22 @@ SAMPLE_FLAGS = {
457471
'CCFLAGS': ['-m64'],
458472
'LINKFLAGS': ['-m64']
459473
},
474+
'arch:mips': {
475+
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
476+
'simulator:none': {
477+
'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'],
478+
'LINKFLAGS': ['-EL'],
479+
'LDFLAGS': ['-EL']
480+
}
481+
},
460482
'simulator:arm': {
461483
'CCFLAGS': ['-m32'],
462484
'LINKFLAGS': ['-m32']
463485
},
486+
'simulator:mips': {
487+
'CCFLAGS': ['-m32'],
488+
'LINKFLAGS': ['-m32']
489+
},
464490
'mode:release': {
465491
'CCFLAGS': ['-O2']
466492
},
@@ -601,7 +627,7 @@ SIMPLE_OPTIONS = {
601627
'help': 'the os to build for (' + OS_GUESS + ')'
602628
},
603629
'arch': {
604-
'values':['arm', 'ia32', 'x64'],
630+
'values':['arm', 'ia32', 'x64', 'mips'],
605631
'default': ARCH_GUESS,
606632
'help': 'the architecture to build for (' + ARCH_GUESS + ')'
607633
},
@@ -651,7 +677,7 @@ SIMPLE_OPTIONS = {
651677
'help': 'use Microsoft Visual C++ link-time code generation'
652678
},
653679
'simulator': {
654-
'values': ['arm', 'none'],
680+
'values': ['arm', 'mips', 'none'],
655681
'default': 'none',
656682
'help': 'build with simulator'
657683
},
@@ -871,6 +897,11 @@ def PostprocessOptions(options):
871897
options['armvariant'] = 'arm'
872898
if (options['armvariant'] != 'none' and options['arch'] != 'arm'):
873899
options['armvariant'] = 'none'
900+
if options['arch'] == 'mips':
901+
if ('regexp' in ARGUMENTS) and options['regexp'] == 'native':
902+
# Print a warning if native regexp is specified for mips
903+
print "Warning: forcing regexp to interpreted for mips"
904+
options['regexp'] = 'interpreted'
874905

875906

876907
def ParseEnvOverrides(arg, imports):

deps/v8/include/v8.h

Lines changed: 85 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -534,51 +534,76 @@ class V8EXPORT ScriptOrigin {
534534
class V8EXPORT Script {
535535
public:
536536

537-
/**
538-
* Compiles the specified script. The ScriptOrigin* and ScriptData*
539-
* parameters are owned by the caller of Script::Compile. No
540-
* references to these objects are kept after compilation finishes.
541-
*
542-
* The script object returned is context independent; when run it
543-
* will use the currently entered context.
544-
*/
545-
static Local<Script> New(Handle<String> source,
546-
ScriptOrigin* origin = NULL,
547-
ScriptData* pre_data = NULL);
537+
/**
538+
* Compiles the specified script (context-independent).
539+
*
540+
* \param source Script source code.
541+
* \param origin Script origin, owned by caller, no references are kept
542+
* when New() returns
543+
* \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
544+
* using pre_data speeds compilation if it's done multiple times.
545+
* Owned by caller, no references are kept when New() returns.
546+
* \param script_data Arbitrary data associated with script. Using
547+
* this has same effect as calling SetData(), but allows data to be
548+
* available to compile event handlers.
549+
* \return Compiled script object (context independent; when run it
550+
* will use the currently entered context).
551+
*/
552+
static Local<Script> New(Handle<String> source,
553+
ScriptOrigin* origin = NULL,
554+
ScriptData* pre_data = NULL,
555+
Handle<String> script_data = Handle<String>());
548556

549-
/**
550-
* Compiles the specified script using the specified file name
551-
* object (typically a string) as the script's origin.
552-
*
553-
* The script object returned is context independent; when run it
554-
* will use the currently entered context.
555-
*/
556-
static Local<Script> New(Handle<String> source,
557-
Handle<Value> file_name);
558-
559-
/**
560-
* Compiles the specified script. The ScriptOrigin* and ScriptData*
561-
* parameters are owned by the caller of Script::Compile. No
562-
* references to these objects are kept after compilation finishes.
557+
/**
558+
* Compiles the specified script using the specified file name
559+
* object (typically a string) as the script's origin.
560+
*
561+
* \param source Script source code.
562+
* \patam file_name file name object (typically a string) to be used
563+
* as the script's origin.
564+
* \return Compiled script object (context independent; when run it
565+
* will use the currently entered context).
566+
*/
567+
static Local<Script> New(Handle<String> source,
568+
Handle<Value> file_name);
569+
570+
/**
571+
* Compiles the specified script (bound to current context).
563572
*
564-
* The script object returned is bound to the context that was active
565-
* when this function was called. When run it will always use this
566-
* context.
573+
* \param source Script source code.
574+
* \param origin Script origin, owned by caller, no references are kept
575+
* when Compile() returns
576+
* \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
577+
* using pre_data speeds compilation if it's done multiple times.
578+
* Owned by caller, no references are kept when Compile() returns.
579+
* \param script_data Arbitrary data associated with script. Using
580+
* this has same effect as calling SetData(), but makes data available
581+
* earlier (i.e. to compile event handlers).
582+
* \return Compiled script object, bound to the context that was active
583+
* when this function was called. When run it will always use this
584+
* context.
567585
*/
568586
static Local<Script> Compile(Handle<String> source,
569587
ScriptOrigin* origin = NULL,
570-
ScriptData* pre_data = NULL);
588+
ScriptData* pre_data = NULL,
589+
Handle<String> script_data = Handle<String>());
571590

572591
/**
573592
* Compiles the specified script using the specified file name
574593
* object (typically a string) as the script's origin.
575594
*
576-
* The script object returned is bound to the context that was active
577-
* when this function was called. When run it will always use this
578-
* context.
595+
* \param source Script source code.
596+
* \param file_name File name to use as script's origin
597+
* \param script_data Arbitrary data associated with script. Using
598+
* this has same effect as calling SetData(), but makes data available
599+
* earlier (i.e. to compile event handlers).
600+
* \return Compiled script object, bound to the context that was active
601+
* when this function was called. When run it will always use this
602+
* context.
579603
*/
580604
static Local<Script> Compile(Handle<String> source,
581-
Handle<Value> file_name);
605+
Handle<Value> file_name,
606+
Handle<String> script_data = Handle<String>());
582607

583608
/**
584609
* Runs the script returning the resulting value. If the script is
@@ -1196,6 +1221,13 @@ class V8EXPORT Object : public Value {
11961221
*/
11971222
Local<Value> GetPrototype();
11981223

1224+
/**
1225+
* Set the prototype object. This does not skip objects marked to
1226+
* be skipped by __proto__ and it does not consult the security
1227+
* handler.
1228+
*/
1229+
bool SetPrototype(Handle<Value> prototype);
1230+
11991231
/**
12001232
* Finds an instance of the given function template in the prototype
12011233
* chain.
@@ -1354,7 +1386,15 @@ class V8EXPORT Function : public Object {
13541386
Local<Value> Call(Handle<Object> recv, int argc, Handle<Value> argv[]);
13551387
void SetName(Handle<String> name);
13561388
Handle<Value> GetName() const;
1389+
1390+
/**
1391+
* Returns zero based line number of function body and
1392+
* kLineOffsetNotFound if no information available.
1393+
*/
1394+
int GetScriptLineNumber() const;
1395+
ScriptOrigin GetScriptOrigin() const;
13571396
static inline Function* Cast(Value* obj);
1397+
static const int kLineOffsetNotFound;
13581398
private:
13591399
Function();
13601400
static void CheckCast(Value* obj);
@@ -2309,22 +2349,30 @@ class V8EXPORT V8 {
23092349
static bool IsProfilerPaused();
23102350

23112351
/**
2312-
* Resumes specified profiler modules.
2352+
* Resumes specified profiler modules. Can be called several times to
2353+
* mark the opening of a profiler events block with the given tag.
2354+
*
23132355
* "ResumeProfiler" is equivalent to "ResumeProfilerEx(PROFILER_MODULE_CPU)".
23142356
* See ProfilerModules enum.
23152357
*
23162358
* \param flags Flags specifying profiler modules.
2359+
* \param tag Profile tag.
23172360
*/
2318-
static void ResumeProfilerEx(int flags);
2361+
static void ResumeProfilerEx(int flags, int tag = 0);
23192362

23202363
/**
2321-
* Pauses specified profiler modules.
2364+
* Pauses specified profiler modules. Each call to "PauseProfilerEx" closes
2365+
* a block of profiler events opened by a call to "ResumeProfilerEx" with the
2366+
* same tag value. There is no need for blocks to be properly nested.
2367+
* The profiler is paused when the last opened block is closed.
2368+
*
23222369
* "PauseProfiler" is equivalent to "PauseProfilerEx(PROFILER_MODULE_CPU)".
23232370
* See ProfilerModules enum.
23242371
*
23252372
* \param flags Flags specifying profiler modules.
2373+
* \param tag Profile tag.
23262374
*/
2327-
static void PauseProfilerEx(int flags);
2375+
static void PauseProfilerEx(int flags, int tag = 0);
23282376

23292377
/**
23302378
* Returns active (resumed) profiler modules.

deps/v8/samples/lineprocessor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ int RunMain(int argc, char* argv[]) {
152152
} else if (strcmp(str, "--main-cycle-in-js") == 0) {
153153
cycle_type = CycleInJs;
154154
} else if (strcmp(str, "-p") == 0 && i + 1 < argc) {
155-
port_number = atoi(argv[i + 1]);
155+
port_number = atoi(argv[i + 1]); // NOLINT
156156
i++;
157157
} else if (strncmp(str, "--", 2) == 0) {
158158
printf("Warning: unknown flag %s.\nTry --help for options\n", str);

deps/v8/src/SConscript

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ SOURCES = {
7272
interpreter-irregexp.cc
7373
jsregexp.cc
7474
jump-target.cc
75+
liveedit.cc
7576
log-utils.cc
7677
log.cc
7778
mark-compact.cc
@@ -131,6 +132,24 @@ SOURCES = {
131132
'armvariant:thumb2': Split("""
132133
arm/assembler-thumb2.cc
133134
"""),
135+
'arch:mips': Split("""
136+
mips/assembler-mips.cc
137+
mips/builtins-mips.cc
138+
mips/codegen-mips.cc
139+
mips/constants-mips.cc
140+
mips/cpu-mips.cc
141+
mips/debug-mips.cc
142+
mips/disasm-mips.cc
143+
mips/fast-codegen-mips.cc
144+
mips/full-codegen-mips.cc
145+
mips/frames-mips.cc
146+
mips/ic-mips.cc
147+
mips/jump-target-mips.cc
148+
mips/macro-assembler-mips.cc
149+
mips/register-allocator-mips.cc
150+
mips/stub-cache-mips.cc
151+
mips/virtual-frame-mips.cc
152+
"""),
134153
'arch:ia32': Split("""
135154
ia32/assembler-ia32.cc
136155
ia32/builtins-ia32.cc
@@ -168,6 +187,7 @@ SOURCES = {
168187
x64/virtual-frame-x64.cc
169188
"""),
170189
'simulator:arm': ['arm/simulator-arm.cc'],
190+
'simulator:mips': ['mips/simulator-mips.cc'],
171191
'os:freebsd': ['platform-freebsd.cc', 'platform-posix.cc'],
172192
'os:openbsd': ['platform-openbsd.cc', 'platform-posix.cc'],
173193
'os:linux': ['platform-linux.cc', 'platform-posix.cc'],

deps/v8/src/accessors.cc

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -647,42 +647,9 @@ Object* Accessors::ObjectGetPrototype(Object* receiver, void*) {
647647
Object* Accessors::ObjectSetPrototype(JSObject* receiver,
648648
Object* value,
649649
void*) {
650-
// Before we can set the prototype we need to be sure
651-
// prototype cycles are prevented.
652-
// It is sufficient to validate that the receiver is not in the new prototype
653-
// chain.
654-
655-
// Silently ignore the change if value is not a JSObject or null.
656-
// SpiderMonkey behaves this way.
657-
if (!value->IsJSObject() && !value->IsNull()) return value;
658-
659-
for (Object* pt = value; pt != Heap::null_value(); pt = pt->GetPrototype()) {
660-
if (JSObject::cast(pt) == receiver) {
661-
// Cycle detected.
662-
HandleScope scope;
663-
return Top::Throw(*Factory::NewError("cyclic_proto",
664-
HandleVector<Object>(NULL, 0)));
665-
}
666-
}
667-
668-
// Find the first object in the chain whose prototype object is not
669-
// hidden and set the new prototype on that object.
670-
JSObject* current = receiver;
671-
Object* current_proto = receiver->GetPrototype();
672-
while (current_proto->IsJSObject() &&
673-
JSObject::cast(current_proto)->map()->is_hidden_prototype()) {
674-
current = JSObject::cast(current_proto);
675-
current_proto = current_proto->GetPrototype();
676-
}
677-
678-
// Set the new prototype of the object.
679-
Object* new_map = current->map()->CopyDropTransitions();
680-
if (new_map->IsFailure()) return new_map;
681-
Map::cast(new_map)->set_prototype(value);
682-
current->set_map(Map::cast(new_map));
683-
650+
const bool skip_hidden_prototypes = true;
684651
// To be consistent with other Set functions, return the value.
685-
return value;
652+
return receiver->SetPrototype(value, skip_hidden_prototypes);
686653
}
687654

688655

0 commit comments

Comments
 (0)