| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 Handle<Object> error = | 570 Handle<Object> error = |
| 571 Factory::NewTypeError("redeclaration", HandleVector(args, 2)); | 571 Factory::NewTypeError("redeclaration", HandleVector(args, 2)); |
| 572 return Top::Throw(*error); | 572 return Top::Throw(*error); |
| 573 } | 573 } |
| 574 | 574 |
| 575 | 575 |
| 576 static Object* Runtime_DeclareGlobals(Arguments args) { | 576 static Object* Runtime_DeclareGlobals(Arguments args) { |
| 577 HandleScope scope; | 577 HandleScope scope; |
| 578 Handle<GlobalObject> global = Handle<GlobalObject>(Top::context()->global()); | 578 Handle<GlobalObject> global = Handle<GlobalObject>(Top::context()->global()); |
| 579 | 579 |
| 580 CONVERT_ARG_CHECKED(FixedArray, pairs, 0); | 580 Handle<Context> context = args.at<Context>(0); |
| 581 Handle<Context> context = args.at<Context>(1); | 581 CONVERT_ARG_CHECKED(FixedArray, pairs, 1); |
| 582 bool is_eval = Smi::cast(args[2])->value() == 1; | 582 bool is_eval = Smi::cast(args[2])->value() == 1; |
| 583 | 583 |
| 584 // Compute the property attributes. According to ECMA-262, section | 584 // Compute the property attributes. According to ECMA-262, section |
| 585 // 13, page 71, the property must be read-only and | 585 // 13, page 71, the property must be read-only and |
| 586 // non-deletable. However, neither SpiderMonkey nor KJS creates the | 586 // non-deletable. However, neither SpiderMonkey nor KJS creates the |
| 587 // property as read-only, so we don't either. | 587 // property as read-only, so we don't either. |
| 588 PropertyAttributes base = is_eval ? NONE : DONT_DELETE; | 588 PropertyAttributes base = is_eval ? NONE : DONT_DELETE; |
| 589 | 589 |
| 590 // Traverse the name/value pairs and set the properties. | 590 // Traverse the name/value pairs and set the properties. |
| 591 int length = pairs->length(); | 591 int length = pairs->length(); |
| (...skipping 3792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4384 JSObject::cast(result)->set_elements(FixedArray::cast(obj), | 4384 JSObject::cast(result)->set_elements(FixedArray::cast(obj), |
| 4385 SKIP_WRITE_BARRIER); | 4385 SKIP_WRITE_BARRIER); |
| 4386 } | 4386 } |
| 4387 return result; | 4387 return result; |
| 4388 } | 4388 } |
| 4389 | 4389 |
| 4390 | 4390 |
| 4391 static Object* Runtime_NewClosure(Arguments args) { | 4391 static Object* Runtime_NewClosure(Arguments args) { |
| 4392 HandleScope scope; | 4392 HandleScope scope; |
| 4393 ASSERT(args.length() == 2); | 4393 ASSERT(args.length() == 2); |
| 4394 CONVERT_ARG_CHECKED(JSFunction, boilerplate, 0); | 4394 CONVERT_ARG_CHECKED(Context, context, 0); |
| 4395 CONVERT_ARG_CHECKED(Context, context, 1); | 4395 CONVERT_ARG_CHECKED(JSFunction, boilerplate, 1); |
| 4396 | 4396 |
| 4397 Handle<JSFunction> result = | 4397 Handle<JSFunction> result = |
| 4398 Factory::NewFunctionFromBoilerplate(boilerplate, context); | 4398 Factory::NewFunctionFromBoilerplate(boilerplate, context); |
| 4399 return *result; | 4399 return *result; |
| 4400 } | 4400 } |
| 4401 | 4401 |
| 4402 | 4402 |
| 4403 static Code* ComputeConstructStub(Handle<SharedFunctionInfo> shared) { | 4403 static Code* ComputeConstructStub(Handle<SharedFunctionInfo> shared) { |
| 4404 // TODO(385): Change this to create a construct stub specialized for | 4404 // TODO(385): Change this to create a construct stub specialized for |
| 4405 // the given map to make allocation of simple objects - and maybe | 4405 // the given map to make allocation of simple objects - and maybe |
| (...skipping 3452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7858 } else { | 7858 } else { |
| 7859 // Handle last resort GC and make sure to allow future allocations | 7859 // Handle last resort GC and make sure to allow future allocations |
| 7860 // to grow the heap without causing GCs (if possible). | 7860 // to grow the heap without causing GCs (if possible). |
| 7861 Counters::gc_last_resort_from_js.Increment(); | 7861 Counters::gc_last_resort_from_js.Increment(); |
| 7862 Heap::CollectAllGarbage(false); | 7862 Heap::CollectAllGarbage(false); |
| 7863 } | 7863 } |
| 7864 } | 7864 } |
| 7865 | 7865 |
| 7866 | 7866 |
| 7867 } } // namespace v8::internal | 7867 } } // namespace v8::internal |
| OLD | NEW |